|
|
@ -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
|
|
|
// 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); |
|
|
_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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_context.Dispatch(_dispatchDescription, _dispatchCommandBuffer); |
|
|
_context.Dispatch(_dispatchDescription, _dispatchCommandBuffer); |
|
|
|
|
|
|
|
|
if (dest == null) |
|
|
|
|
|
{ |
|
|
|
|
|
// Output the upscaled image to the backbuffer
|
|
|
// Output the upscaled image to the backbuffer
|
|
|
_dispatchCommandBuffer.Blit(Fsr2Pipeline.UavUpscaledOutput, dest); |
|
|
_dispatchCommandBuffer.Blit(Fsr2Pipeline.UavUpscaledOutput, dest); |
|
|
_dispatchCommandBuffer.ReleaseTemporaryRT(Fsr2Pipeline.UavUpscaledOutput); |
|
|
_dispatchCommandBuffer.ReleaseTemporaryRT(Fsr2Pipeline.UavUpscaledOutput); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (autoGenerateReactiveMask) |
|
|
if (autoGenerateReactiveMask) |
|
|
{ |
|
|
{ |
|
|
|