|
|
@ -14,7 +14,7 @@ namespace FidelityFX.FrameGen |
|
|
protected ComputeShader ComputeShader; |
|
|
protected ComputeShader ComputeShader; |
|
|
protected int KernelIndex; |
|
|
protected int KernelIndex; |
|
|
|
|
|
|
|
|
private CustomSampler _sampler; |
|
|
|
|
|
|
|
|
protected CustomSampler Sampler; |
|
|
|
|
|
|
|
|
protected FrameInterpolationPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants) |
|
|
protected FrameInterpolationPass(FrameInterpolation.ContextDescription contextDescription, FrameInterpolationResources resources, ComputeBuffer constants) |
|
|
{ |
|
|
{ |
|
|
@ -29,9 +29,9 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
|
public void ScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ = 1) |
|
|
public void ScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ = 1) |
|
|
{ |
|
|
{ |
|
|
commandBuffer.BeginSample(_sampler); |
|
|
|
|
|
|
|
|
commandBuffer.BeginSample(Sampler); |
|
|
DoScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchX, dispatchY, dispatchZ); |
|
|
DoScheduleDispatch(commandBuffer, dispatchParams, frameIndex, dispatchX, dispatchY, dispatchZ); |
|
|
commandBuffer.EndSample(_sampler); |
|
|
|
|
|
|
|
|
commandBuffer.EndSample(Sampler); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected abstract void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ); |
|
|
protected abstract void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ); |
|
|
@ -50,7 +50,7 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
|
ComputeShader = shader; |
|
|
ComputeShader = shader; |
|
|
KernelIndex = ComputeShader.FindKernel("CS"); |
|
|
KernelIndex = ComputeShader.FindKernel("CS"); |
|
|
_sampler = CustomSampler.Create(passName); |
|
|
|
|
|
|
|
|
Sampler = CustomSampler.Create(passName); |
|
|
|
|
|
|
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_LOW_RES_MOTION_VECTORS"); |
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_LOW_RES_MOTION_VECTORS"); |
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableJitterMotionVectors) != 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_JITTERED_MOTION_VECTORS"); |
|
|
if ((flags & FrameInterpolation.InitializationFlags.EnableJitterMotionVectors) != 0) ComputeShader.EnableKeyword("FFX_FRAMEINTERPOLATION_OPTION_JITTERED_MOTION_VECTORS"); |
|
|
@ -68,7 +68,13 @@ namespace FidelityFX.FrameGen |
|
|
|
|
|
|
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
protected override void DoScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
{ |
|
|
{ |
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void ScheduleDispatch(CommandBuffer commandBuffer, FrameInterpolation.PrepareDescription prepareParams, int frameIndex, int dispatchX, int dispatchY, int dispatchZ) |
|
|
|
|
|
{ |
|
|
|
|
|
commandBuffer.BeginSample(Sampler); |
|
|
|
|
|
|
|
|
|
|
|
commandBuffer.EndSample(Sampler); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|