|
|
|
@ -59,6 +59,17 @@ namespace FidelityFX.FrameGen |
|
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableJitterMotionVectors) != 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_JITTERED_MOTION_VECTORS"); |
|
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableDepthInverted) != 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_INVERTED_DEPTH"); |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal class FrameInterpolationReconstructAndDilatePass : FrameInterpolationPass |
|
|
|
@ -133,16 +144,11 @@ namespace FidelityFX.FrameGen |
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
int doubleBufferId = AsyncSupported ? frameIndex : 0; |
|
|
|
ref var backBuf = ref dispatchParams.currentBackBuffer; |
|
|
|
ref var bbNoHud = ref dispatchParams.currentBackBuffer_HUDLess; |
|
|
|
|
|
|
|
// TODO: verify that we need the buffers from *this* frame (probably yes)
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[doubleBufferId]); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDilatedDepth, Resources.DilatedDepth[doubleBufferId]); |
|
|
|
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); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavReconstructedDepthInterpolatedFrame, Resources.ReconstructedDepthInterpolatedFrame); |
|
|
|
|
|
|
|
@ -163,16 +169,11 @@ namespace FidelityFX.FrameGen |
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
int doubleBufferId = AsyncSupported ? frameIndex : 0; |
|
|
|
ref var backBuf = ref dispatchParams.currentBackBuffer; |
|
|
|
ref var bbNoHud = ref dispatchParams.currentBackBuffer_HUDLess; |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDilatedMotionVectors, Resources.DilatedMotionVectors[doubleBufferId]); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDilatedDepth, Resources.DilatedDepth[doubleBufferId]); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvPreviousInterpolationSource, Resources.PreviousInterpolationSource); |
|
|
|
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); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavGameMotionVectorFieldX, Resources.GameMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavGameMotionVectorFieldY, Resources.GameMotionVectorFieldY); |
|
|
|
@ -195,8 +196,6 @@ namespace FidelityFX.FrameGen |
|
|
|
{ |
|
|
|
int doubleBufferId = AsyncSupported ? frameIndex : 0; |
|
|
|
ref var ofVector = ref dispatchParams.opticalFlowVector; |
|
|
|
ref var backBuf = ref dispatchParams.currentBackBuffer; |
|
|
|
ref var bbNoHud = ref dispatchParams.currentBackBuffer_HUDLess; |
|
|
|
|
|
|
|
if (dispatchParams.opticalFlowScale.x > 0f) |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowVector, ofVector.RenderTarget, ofVector.MipLevel, ofVector.SubElement); |
|
|
|
@ -207,10 +206,7 @@ namespace FidelityFX.FrameGen |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowConfidence, BuiltinRenderTextureType.None); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDilatedDepth, Resources.DilatedDepth[doubleBufferId]); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvPreviousInterpolationSource, Resources.PreviousInterpolationSource); |
|
|
|
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); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavOpticalFlowMotionVectorFieldX, Resources.OpticalFlowMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavOpticalFlowMotionVectorFieldY, Resources.OpticalFlowMotionVectorFieldY); |
|
|
|
@ -258,7 +254,18 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldX, Resources.GameMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldY, Resources.GameMotionVectorFieldY); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowMotionVectorFieldX, Resources.OpticalFlowMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowMotionVectorFieldY, Resources.OpticalFlowMotionVectorFieldY); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvPreviousInterpolationSource, Resources.PreviousInterpolationSource); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDisocclusionMask, Resources.DisocclusionMask); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvInpaintingPyramid, Resources.InpaintingPyramid); |
|
|
|
commandBuffer.SetComputeBufferParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvCounters, Resources.Counters); |
|
|
|
|
|
|
|
ref var output = ref dispatchParams.output; |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavOutput, output.RenderTarget, output.MipLevel, output.SubElement); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbFrameInterpolation, Constants, 0, Marshal.SizeOf<FrameInterpolation.Constants>()); |
|
|
|
|
|
|
|
@ -268,17 +275,38 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
internal class FrameInterpolationInpaintingPyramidPass : FrameInterpolationPass |
|
|
|
{ |
|
|
|
public FrameInterpolationInpaintingPyramidPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants) |
|
|
|
private readonly ComputeBuffer _spdConstants; |
|
|
|
|
|
|
|
public FrameInterpolationInpaintingPyramidPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants, ComputeBuffer spdConstants) |
|
|
|
: base(contextDescription, resources, constants) |
|
|
|
{ |
|
|
|
_spdConstants = spdConstants; |
|
|
|
|
|
|
|
InitComputeShader("Inpainting Pyramid", contextDescription.shaders.inpaintingPyramid); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
ref var output = ref dispatchParams.output; |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOutput, output.RenderTarget, output.MipLevel, output.SubElement); |
|
|
|
|
|
|
|
commandBuffer.SetComputeBufferParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavCounters, Resources.Counters); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap0, Resources.InpaintingPyramid, 0); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap1, Resources.InpaintingPyramid, 1); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap2, Resources.InpaintingPyramid, 2); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap3, Resources.InpaintingPyramid, 3); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap4, Resources.InpaintingPyramid, 4); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap5, Resources.InpaintingPyramid, 5); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap6, Resources.InpaintingPyramid, 6); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap7, Resources.InpaintingPyramid, 7); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap8, Resources.InpaintingPyramid, 8); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap9, Resources.InpaintingPyramid, 9); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap10, Resources.InpaintingPyramid, 10); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap11, Resources.InpaintingPyramid, 11); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap12, Resources.InpaintingPyramid, 12); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbFrameInterpolation, Constants, 0, Marshal.SizeOf<FrameInterpolation.Constants>()); |
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbInpaintingPyramid, _spdConstants, 0, Marshal.SizeOf<FrameInterpolation.InpaintingPyramidConstants>()); |
|
|
|
|
|
|
|
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, dispatchZ); |
|
|
|
} |
|
|
|
@ -294,7 +322,16 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
ref var scd = ref dispatchParams.opticalFlowSceneChangeDetection; |
|
|
|
ref var backBuf = ref dispatchParams.currentBackBuffer; |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowSceneChangeDetection, scd.RenderTarget, scd.MipLevel, scd.SubElement); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvInpaintingPyramid, Resources.InpaintingPyramid); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvPresentBackbuffer, backBuf.RenderTarget, backBuf.MipLevel, backBuf.SubElement); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
|
|
|
|
ref var output = ref dispatchParams.output; |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavOutput, output.RenderTarget, output.MipLevel, output.SubElement); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbFrameInterpolation, Constants, 0, Marshal.SizeOf<FrameInterpolation.Constants>()); |
|
|
|
|
|
|
|
@ -304,17 +341,38 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
internal class FrameInterpolationGameVectorFieldInpaintingPyramidPass : FrameInterpolationPass |
|
|
|
{ |
|
|
|
public FrameInterpolationGameVectorFieldInpaintingPyramidPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants) |
|
|
|
private readonly ComputeBuffer _spdConstants; |
|
|
|
|
|
|
|
public FrameInterpolationGameVectorFieldInpaintingPyramidPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants, ComputeBuffer spdConstants) |
|
|
|
: base(contextDescription, resources, constants) |
|
|
|
{ |
|
|
|
_spdConstants = spdConstants; |
|
|
|
|
|
|
|
InitComputeShader("Game Vector Field Inpainting Pyramid", contextDescription.shaders.gameVectorFieldInpaintingPyramid); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldX, Resources.GameMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldY, Resources.GameMotionVectorFieldY); |
|
|
|
|
|
|
|
commandBuffer.SetComputeBufferParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavCounters, Resources.Counters); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap0, Resources.InpaintingPyramid, 0); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap1, Resources.InpaintingPyramid, 1); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap2, Resources.InpaintingPyramid, 2); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap3, Resources.InpaintingPyramid, 3); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap4, Resources.InpaintingPyramid, 4); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap5, Resources.InpaintingPyramid, 5); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap6, Resources.InpaintingPyramid, 6); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap7, Resources.InpaintingPyramid, 7); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap8, Resources.InpaintingPyramid, 8); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap9, Resources.InpaintingPyramid, 9); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap10, Resources.InpaintingPyramid, 10); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap11, Resources.InpaintingPyramid, 11); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavInpaintingPyramidMipmap12, Resources.InpaintingPyramid, 12); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbFrameInterpolation, Constants, 0, Marshal.SizeOf<FrameInterpolation.Constants>()); |
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbInpaintingPyramid, _spdConstants, 0, Marshal.SizeOf<FrameInterpolation.InpaintingPyramidConstants>()); |
|
|
|
|
|
|
|
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, dispatchZ); |
|
|
|
} |
|
|
|
@ -330,7 +388,19 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
ref var backBuf = ref dispatchParams.currentBackBuffer; |
|
|
|
|
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldX, Resources.GameMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvGameMotionVectorFieldY, Resources.GameMotionVectorFieldY); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowMotionVectorFieldX, Resources.OpticalFlowMotionVectorFieldX); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvOpticalFlowMotionVectorFieldY, Resources.OpticalFlowMotionVectorFieldY); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvDisocclusionMask, Resources.DisocclusionMask); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvPresentBackbuffer, backBuf.RenderTarget, backBuf.MipLevel, backBuf.SubElement); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.SrvInpaintingPyramid, Resources.InpaintingPyramid); |
|
|
|
BindCurrentInterpolationSource(commandBuffer, dispatchParams); |
|
|
|
|
|
|
|
ref var output = ref dispatchParams.output; |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, FrameInterpolationShaderIDs.UavOutput, output.RenderTarget, output.MipLevel, output.SubElement); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, FrameInterpolationShaderIDs.CbFrameInterpolation, Constants, 0, Marshal.SizeOf<FrameInterpolation.Constants>()); |
|
|
|
|
|
|
|
|