|
|
@ -63,6 +63,8 @@ namespace FidelityFX |
|
|
private CommandBuffer _opaqueInputCommandBuffer; |
|
|
private CommandBuffer _opaqueInputCommandBuffer; |
|
|
private CommandBuffer _inputsCommandBuffer; |
|
|
private CommandBuffer _inputsCommandBuffer; |
|
|
|
|
|
|
|
|
|
|
|
private RenderTextureFormat DefaultFormat => _renderCamera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; |
|
|
|
|
|
|
|
|
private void OnEnable() |
|
|
private void OnEnable() |
|
|
{ |
|
|
{ |
|
|
// Set up the original camera to output all of the required FSR2 input resources at the desired resolution
|
|
|
// Set up the original camera to output all of the required FSR2 input resources at the desired resolution
|
|
|
@ -88,7 +90,7 @@ namespace FidelityFX |
|
|
|
|
|
|
|
|
// Create command buffers to bind the camera's output at the right moments in the render loop
|
|
|
// Create command buffers to bind the camera's output at the right moments in the render loop
|
|
|
_opaqueInputCommandBuffer = new CommandBuffer { name = "FSR2 Opaque Input" }; |
|
|
_opaqueInputCommandBuffer = new CommandBuffer { name = "FSR2 Opaque Input" }; |
|
|
_opaqueInputCommandBuffer.GetTemporaryRT(Fsr2Pipeline.SrvOpaqueOnly, _renderSize.x, _renderSize.y, 0, default, RenderTextureFormat.ARGBHalf); |
|
|
|
|
|
|
|
|
_opaqueInputCommandBuffer.GetTemporaryRT(Fsr2Pipeline.SrvOpaqueOnly, _renderSize.x, _renderSize.y, 0, default, DefaultFormat); |
|
|
_opaqueInputCommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, Fsr2Pipeline.SrvOpaqueOnly); |
|
|
_opaqueInputCommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, Fsr2Pipeline.SrvOpaqueOnly); |
|
|
|
|
|
|
|
|
_inputsCommandBuffer = new CommandBuffer { name = "FSR2 Inputs" }; |
|
|
_inputsCommandBuffer = new CommandBuffer { name = "FSR2 Inputs" }; |
|
|
@ -268,7 +270,7 @@ namespace FidelityFX |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 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, GraphicsFormat.R16G16B16A16_SFloat, 1, true); |
|
|
|
|
|
|
|
|
_dispatchCommandBuffer.GetTemporaryRT(Fsr2Pipeline.UavUpscaledOutput, _displaySize.x, _displaySize.y, 0, default, DefaultFormat, default, 1, true); |
|
|
|
|
|
|
|
|
_context.Dispatch(_dispatchDescription, _dispatchCommandBuffer); |
|
|
_context.Dispatch(_dispatchDescription, _dispatchCommandBuffer); |
|
|
|
|
|
|
|
|
|