Browse Source

Simplified backbuffer selection for interpolation source

fsr3framegen
Nico de Poel 2 years ago
parent
commit
875b90f6ef
  1. 11
      Runtime/FrameInterpolation/FrameInterpolation.cs
  2. 5
      Runtime/FrameInterpolation/FrameInterpolationContext.cs
  3. 7
      Runtime/FrameInterpolation/FrameInterpolationPass.cs

11
Runtime/FrameInterpolation/FrameInterpolation.cs

@ -86,6 +86,17 @@ namespace FidelityFX.FrameGen
public BackbufferTransferFunction backbufferTransferFunction;
public Vector2 minMaxLuminance;
public ulong frameID;
public ref ResourceView InterpolationSource
{
get
{
if (currentBackBuffer_HUDLess.IsValid)
return ref currentBackBuffer_HUDLess;
return ref currentBackBuffer;
}
}
}
public enum BackbufferTransferFunction

5
Runtime/FrameInterpolation/FrameInterpolationContext.cs

@ -227,9 +227,8 @@ namespace FidelityFX.FrameGen
}
// Store current buffer
ref var backBuf = ref dispatchDescription.currentBackBuffer;
ref var bbNoHud = ref dispatchDescription.currentBackBuffer_HUDLess;
commandBuffer.CopyTexture(bbNoHud.IsValid ? bbNoHud.RenderTarget : backBuf.RenderTarget, _resources.PreviousInterpolationSource);
ref var backBuf = ref dispatchDescription.InterpolationSource;
commandBuffer.CopyTexture(backBuf.RenderTarget, _resources.PreviousInterpolationSource);
commandBuffer.EndSample(_sampler);
}

7
Runtime/FrameInterpolation/FrameInterpolationPass.cs

@ -60,12 +60,7 @@ namespace FidelityFX.FrameGen
protected void BindCurrentInterpolationSource(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams)
{
ref var backBuf = ref dispatchParams.currentBackBuffer;
ref var bbNoHud = ref dispatchParams.currentBackBuffer_HUDLess;
if (bbNoHud.IsValid)
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvCurrentInterpolationSource, bbNoHud.RenderTarget, bbNoHud.MipLevel, bbNoHud.SubElement);
else
ref var backBuf = ref dispatchParams.InterpolationSource;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvCurrentInterpolationSource, backBuf.RenderTarget, backBuf.MipLevel, backBuf.SubElement);
}

Loading…
Cancel
Save