Browse Source

Ported clearing code for reconstructed depth buffer, which is new in FSR3. This replaces clearing in the Lock pass, allowing the buffer to be reused after upscaling is done.

fsr3
Nico de Poel 2 years ago
parent
commit
6e20557253
  1. 5
      Assets/Scripts/Core/Fsr2Context.cs

5
Assets/Scripts/Core/Fsr2Context.cs

@ -214,6 +214,11 @@ namespace FidelityFX
commandBuffer.ClearRenderTarget(false, true, Color.clear);
}
// FSR3: need to clear here since we need the content of this surface for frame interpolation, so clearing in the lock pass is not an option
bool depthInverted = (_contextDescription.Flags & Fsr2.InitializationFlags.EnableDepthInverted) == Fsr2.InitializationFlags.EnableDepthInverted;
commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavReconstructedPrevNearestDepth);
commandBuffer.ClearRenderTarget(false, true, depthInverted ? Color.clear : Color.white);
// Auto exposure
SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);

Loading…
Cancel
Save