Browse Source

Revert "Reintroduced the ability for FSR2 to output to a render texture again. Very basic for now."

This reverts commit bb24ed970b.
mac-autoexp
Nico de Poel 3 years ago
parent
commit
0548c63800
  1. 29
      Assets/Scripts/Fsr2Controller.cs

29
Assets/Scripts/Fsr2Controller.cs

@ -248,6 +248,14 @@ namespace FidelityFX
_renderCamera.rect = _originalRect; _renderCamera.rect = _originalRect;
_renderCamera.ResetProjectionMatrix(); _renderCamera.ResetProjectionMatrix();
if (dest != null)
{
Debug.LogError("FSR2 is not set to output directly to the backbuffer! Please ensure that FSR2 is the final pass in the image effects chain.");
Graphics.Blit(src, dest);
enabled = false;
return;
}
_dispatchCommandBuffer.Clear(); _dispatchCommandBuffer.Clear();
// Update the input resource descriptions // Update the input resource descriptions
@ -262,25 +270,14 @@ namespace FidelityFX
_dispatchDescription.Reactive = Fsr2Pipeline.UavAutoReactive; _dispatchDescription.Reactive = Fsr2Pipeline.UavAutoReactive;
} }
if (dest == null)
{
// We are rendering to the backbuffer, so we need a temporary render texture for FSR2 to output to
_dispatchCommandBuffer.GetTemporaryRT(Fsr2Pipeline.UavUpscaledOutput, _displaySize.x, _displaySize.y, 0, default, DefaultFormat, default, 1, true);
}
else
{
// We have more image effects lined up after this, so FSR2 can output straight to the intermediate render texture
_dispatchCommandBuffer.SetGlobalTexture(Fsr2Pipeline.UavUpscaledOutput, dest, RenderTextureSubElement.Color);
}
// We are rendering to the backbuffer, so we need a temporary render texture for FSR2 to output to
_dispatchCommandBuffer.GetTemporaryRT(Fsr2Pipeline.UavUpscaledOutput, _displaySize.x, _displaySize.y, 0, default, DefaultFormat, default, 1, true);
_context.Dispatch(_dispatchDescription, _dispatchCommandBuffer); _context.Dispatch(_dispatchDescription, _dispatchCommandBuffer);
if (dest == null)
{
// Output the upscaled image to the backbuffer
_dispatchCommandBuffer.Blit(Fsr2Pipeline.UavUpscaledOutput, dest);
_dispatchCommandBuffer.ReleaseTemporaryRT(Fsr2Pipeline.UavUpscaledOutput);
}
// Output the upscaled image to the backbuffer
_dispatchCommandBuffer.Blit(Fsr2Pipeline.UavUpscaledOutput, dest);
_dispatchCommandBuffer.ReleaseTemporaryRT(Fsr2Pipeline.UavUpscaledOutput);
if (autoGenerateReactiveMask) if (autoGenerateReactiveMask)
{ {

Loading…
Cancel
Save