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. 9
      Runtime/FrameInterpolation/FrameInterpolationPass.cs

11
Runtime/FrameInterpolation/FrameInterpolation.cs

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

5
Runtime/FrameInterpolation/FrameInterpolationContext.cs

@ -227,9 +227,8 @@ namespace FidelityFX.FrameGen
} }
// Store current buffer // 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); commandBuffer.EndSample(_sampler);
} }

9
Runtime/FrameInterpolation/FrameInterpolationPass.cs

@ -60,13 +60,8 @@ namespace FidelityFX.FrameGen
protected void BindCurrentInterpolationSource(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams) 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
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvCurrentInterpolationSource, backBuf.RenderTarget, backBuf.MipLevel, backBuf.SubElement);
ref var backBuf = ref dispatchParams.InterpolationSource;
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvCurrentInterpolationSource, backBuf.RenderTarget, backBuf.MipLevel, backBuf.SubElement);
} }
protected void BindMipmap(CommandBuffer commandBuffer, int nameID, RenderTexture renderTexture, int mipLevel) protected void BindMipmap(CommandBuffer commandBuffer, int nameID, RenderTexture renderTexture, int mipLevel)

Loading…
Cancel
Save