diff --git a/Runtime/Common/FfxPassBase.cs b/Runtime/Common/FfxPassBase.cs index 5985cd2..c1e44cc 100644 --- a/Runtime/Common/FfxPassBase.cs +++ b/Runtime/Common/FfxPassBase.cs @@ -5,29 +5,18 @@ using UnityEngine.Rendering; namespace FidelityFX { - internal abstract class FfxPassBase: IDisposable - where TDispatch: struct + internal abstract class FfxPassBase: IDisposable { private readonly string _techName; + private string _passName; protected ComputeShader ComputeShader; protected int KernelIndex; - - protected CustomSampler Sampler; protected FfxPassBase(string techName) { _techName = techName; } - - public void ScheduleDispatch(CommandBuffer commandBuffer, in TDispatch dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ = 1) - { - commandBuffer.BeginSample(Sampler); - DoScheduleDispatch(commandBuffer, dispatchParams, bufferIndex, dispatchX, dispatchY, dispatchZ); - commandBuffer.EndSample(Sampler); - } - - protected abstract void DoScheduleDispatch(CommandBuffer commandBuffer, in TDispatch dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ); protected virtual void InitComputeShader(string passName, ComputeShader shader, string kernelName = "CS") { @@ -36,18 +25,40 @@ namespace FidelityFX throw new MissingReferenceException($"Shader for {_techName} pass '{passName}' could not be loaded! Please ensure it is included in the project correctly."); } + _passName = passName; ComputeShader = shader; KernelIndex = ComputeShader.FindKernel(kernelName); - Sampler = CustomSampler.Create(passName); } public virtual void Dispose() { } + + protected ProfilerSampler ProfilerSample(CommandBuffer commandBuffer) + { + return new ProfilerSampler(_passName, commandBuffer); + } + + protected readonly struct ProfilerSampler : IDisposable + { + private readonly string _name; + private readonly CommandBuffer _commandBuffer; + + public ProfilerSampler(string name, CommandBuffer commandBuffer) + { + _name = name; + _commandBuffer = commandBuffer; + _commandBuffer.BeginSample(_name); + } + + public void Dispose() + { + _commandBuffer.EndSample(_name); + } + } } - internal abstract class FfxPassWithFlags : FfxPassBase - where TDispatch: struct + internal abstract class FfxPassWithFlags : FfxPassBase where TFlags: Enum { protected readonly TFlags Flags; diff --git a/Runtime/FSR2/Fsr2Pass.cs b/Runtime/FSR2/Fsr2Pass.cs index 4d8df06..00a8f7e 100644 --- a/Runtime/FSR2/Fsr2Pass.cs +++ b/Runtime/FSR2/Fsr2Pass.cs @@ -28,7 +28,7 @@ namespace FidelityFX.FSR2 /// This loosely matches the FfxPipelineState struct from the original FSR2 codebase, wrapped in an object-oriented blanket. /// These classes are responsible for loading compute shaders, managing temporary resources, binding resources to shader kernels and dispatching said shaders. /// - internal abstract class Fsr2Pass: FfxPassWithFlags + internal abstract class Fsr2Pass: FfxPassWithFlags { internal const int ShadingChangeMipLevel = 4; // This matches the FFX_FSR2_SHADING_CHANGE_MIP_LEVEL define @@ -42,6 +42,16 @@ namespace FidelityFX.FSR2 Constants = constants; } + public void ScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ = 1) + { + using (ProfilerSample(commandBuffer)) + { + Dispatch(commandBuffer, dispatchParams, bufferIndex, dispatchX, dispatchY, dispatchZ); + } + } + + protected abstract void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ); + protected override void SetupShaderKeywords() { bool useLut = false; @@ -74,7 +84,7 @@ namespace FidelityFX.FSR2 InitComputeShader("Compute Luminance Pyramid", contextDescription.Shaders.computeLuminancePyramidPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.Color); @@ -98,7 +108,7 @@ namespace FidelityFX.FSR2 InitComputeShader("Reconstruct & Dilate", contextDescription.Shaders.reconstructPreviousDepthPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.Color); commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputDepth, dispatchParams.Depth); @@ -121,7 +131,7 @@ namespace FidelityFX.FSR2 InitComputeShader("Depth Clip", contextDescription.Shaders.depthClipPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.Color); commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputDepth, dispatchParams.Depth); @@ -149,7 +159,7 @@ namespace FidelityFX.FSR2 InitComputeShader("Create Locks", contextDescription.Shaders.lockPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvLockInputLuma, Fsr2ShaderIDs.UavLockInputLuma); commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbFsr2, Constants); @@ -175,7 +185,7 @@ namespace FidelityFX.FSR2 #endif } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { #if UNITY_2021_2_OR_NEWER if (dispatchParams.EnableSharpening) @@ -234,7 +244,7 @@ namespace FidelityFX.FSR2 InitComputeShader("RCAS Sharpening", contextDescription.Shaders.sharpenPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputExposure, dispatchParams.Exposure); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvRcasInput, Resources.InternalUpscaled[bufferIndex]); @@ -260,23 +270,22 @@ namespace FidelityFX.FSR2 InitComputeShader("Auto-Generate Reactive Mask", contextDescription.Shaders.autoGenReactivePass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { } public void ScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.GenerateReactiveDescription dispatchParams, int dispatchX, int dispatchY) { - commandBuffer.BeginSample(Sampler); - - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.ColorPreUpscale); - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoReactive, dispatchParams.OutReactive); - - commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbGenReactive, _generateReactiveConstants); - - commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); - - commandBuffer.EndSample(Sampler); + using (ProfilerSample(commandBuffer)) + { + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.ColorPreUpscale); + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.UavAutoReactive, dispatchParams.OutReactive); + + commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr2ShaderIDs.CbGenReactive, _generateReactiveConstants); + + commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); + } } } @@ -292,7 +301,7 @@ namespace FidelityFX.FSR2 InitComputeShader("Auto-Generate Transparency & Composition Mask", contextDescription.Shaders.tcrAutoGenPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr2.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr2ShaderIDs.SrvInputColor, dispatchParams.Color); diff --git a/Runtime/FSR3/Fsr3UpscalerPass.cs b/Runtime/FSR3/Fsr3UpscalerPass.cs index 73b7a3c..cdf9e48 100644 --- a/Runtime/FSR3/Fsr3UpscalerPass.cs +++ b/Runtime/FSR3/Fsr3UpscalerPass.cs @@ -28,7 +28,7 @@ namespace FidelityFX.FSR3 /// This loosely matches the FfxPipelineState struct from the original FSR3 codebase, wrapped in an object-oriented blanket. /// These classes are responsible for loading compute shaders, managing temporary resources, binding resources to shader kernels and dispatching said shaders. /// - internal abstract class Fsr3UpscalerPass: FfxPassWithFlags + internal abstract class Fsr3UpscalerPass: FfxPassWithFlags { protected readonly Fsr3UpscalerResources Resources; protected readonly ComputeBuffer Constants; @@ -39,6 +39,16 @@ namespace FidelityFX.FSR3 Resources = resources; Constants = constants; } + + public void ScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ = 1) + { + using (ProfilerSample(commandBuffer)) + { + Dispatch(commandBuffer, dispatchParams, bufferIndex, dispatchX, dispatchY, dispatchZ); + } + } + + protected abstract void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ); protected override void SetupShaderKeywords() { @@ -68,7 +78,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Prepare Inputs", contextDescription.Shaders.prepareInputsPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, dispatchParams.Color); commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputDepth, dispatchParams.Depth); @@ -98,7 +108,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Compute Luminance Pyramid", contextDescription.Shaders.lumaPyramidPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvCurrentLuma, Resources.Luma[bufferIndex]); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvFarthestDepth, Fsr3ShaderIDs.UavIntermediate); @@ -131,7 +141,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Compute Shading Change Pyramid", contextDescription.Shaders.shadingChangePyramidPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvCurrentLuma, Resources.Luma[bufferIndex]); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvPreviousLuma, Resources.Luma[bufferIndex ^ 1]); @@ -161,7 +171,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Compute Shading Change", contextDescription.Shaders.shadingChangePass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvSpdMips, Resources.SpdMips); @@ -179,7 +189,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Prepare Reactivity", contextDescription.Shaders.prepareReactivityPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvReconstructedPrevNearestDepth, Resources.ReconstructedPrevNearestDepth); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedVelocity); @@ -207,7 +217,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Compute Luminance Instability", contextDescription.Shaders.lumaInstabilityPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, dispatchParams.Exposure); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedReactiveMasks, Fsr3ShaderIDs.UavDilatedReactiveMasks); @@ -243,7 +253,7 @@ namespace FidelityFX.FSR3 #endif } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { #if UNITY_2021_2_OR_NEWER if (dispatchParams.EnableSharpening) @@ -297,7 +307,7 @@ namespace FidelityFX.FSR3 InitComputeShader("RCAS Sharpening", contextDescription.Shaders.sharpenPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputExposure, dispatchParams.Exposure); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvRcasInput, Resources.InternalUpscaled[bufferIndex]); @@ -323,23 +333,22 @@ namespace FidelityFX.FSR3 InitComputeShader("Auto-Generate Reactive Mask", contextDescription.Shaders.autoGenReactivePass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { } public void ScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.GenerateReactiveDescription dispatchParams, int dispatchX, int dispatchY) { - commandBuffer.BeginSample(Sampler); - - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, dispatchParams.ColorPreUpscale); - commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoReactive, dispatchParams.OutReactive); - - commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbGenReactive, _generateReactiveConstants); - - commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); - - commandBuffer.EndSample(Sampler); + using (ProfilerSample(commandBuffer)) + { + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, dispatchParams.ColorPreUpscale); + commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.UavAutoReactive, dispatchParams.OutReactive); + + commandBuffer.SetComputeConstantBufferParam(ComputeShader, Fsr3ShaderIDs.CbGenReactive, _generateReactiveConstants); + + commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); + } } } @@ -355,7 +364,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Auto-Generate Transparency & Composition Mask", contextDescription.Shaders.tcrAutoGenPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); commandBuffer.SetComputeResourceParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvInputColor, dispatchParams.Color); @@ -386,7 +395,7 @@ namespace FidelityFX.FSR3 InitComputeShader("Debug View", contextDescription.Shaders.debugViewPass); } - protected override void DoScheduleDispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) + protected override void Dispatch(CommandBuffer commandBuffer, in Fsr3Upscaler.DispatchDescription dispatchParams, int bufferIndex, int dispatchX, int dispatchY, int dispatchZ) { commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedReactiveMasks, Fsr3ShaderIDs.UavDilatedReactiveMasks); commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, Fsr3ShaderIDs.SrvDilatedMotionVectors, Resources.DilatedVelocity);