|
|
|
@ -52,6 +52,7 @@ namespace FidelityFX |
|
|
|
protected static readonly int UavInternalUpscaled = Shader.PropertyToID("rw_internal_upscaled_color"); |
|
|
|
protected static readonly int UavLockStatus = Shader.PropertyToID("rw_lock_status"); |
|
|
|
protected static readonly int UavLumaHistory = Shader.PropertyToID("rw_luma_history"); |
|
|
|
protected static readonly int UavAutoReactive = Shader.PropertyToID("rw_output_autoreactive"); |
|
|
|
|
|
|
|
// Constant buffer bindings
|
|
|
|
protected static readonly int CbFsr2 = Shader.PropertyToID("cbFSR2"); |
|
|
|
@ -338,4 +339,32 @@ namespace FidelityFX |
|
|
|
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal class Fsr2GenerateReactivePipeline : Fsr2Pipeline |
|
|
|
{ |
|
|
|
private readonly ComputeBuffer _generateReactiveConstants; |
|
|
|
|
|
|
|
public Fsr2GenerateReactivePipeline(Fsr2.ContextDescription contextDescription, Fsr2Resources resources, ComputeBuffer generateReactiveConstants) |
|
|
|
: base(contextDescription, resources, null) |
|
|
|
{ |
|
|
|
_generateReactiveConstants = generateReactiveConstants; |
|
|
|
|
|
|
|
LoadComputeShader("FSR2/ffx_fsr2_autogen_reactive_pass"); |
|
|
|
} |
|
|
|
|
|
|
|
public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public void ScheduleDispatch(CommandBuffer commandBuffer, Fsr2.GenerateReactiveDescription dispatchParams, int dispatchX, int dispatchY) |
|
|
|
{ |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, SrvOpaqueOnly, dispatchParams.ColorOpaqueOnly); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, SrvInputColor, dispatchParams.ColorPreUpscale); |
|
|
|
commandBuffer.SetComputeTextureParam(ComputeShader, KernelIndex, UavAutoExposure, dispatchParams.OutReactive); |
|
|
|
|
|
|
|
commandBuffer.SetComputeConstantBufferParam(ComputeShader, CbGenReactive, _generateReactiveConstants, 0, Marshal.SizeOf<Fsr2.GenerateReactiveConstants>()); |
|
|
|
|
|
|
|
commandBuffer.DispatchCompute(ComputeShader, KernelIndex, dispatchX, dispatchY, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |