|
|
@ -63,11 +63,6 @@ namespace FidelityFX |
|
|
CreatePipelines(); |
|
|
CreatePipelines(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// private void InitShaders()
|
|
|
|
|
|
// {
|
|
|
|
|
|
// LoadComputeShader("FSR2/ffx_fsr2_autogen_reactive_pass", ref _generateReactiveShader, out _generateReactiveKernel);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private void CreatePipelines() |
|
|
private void CreatePipelines() |
|
|
{ |
|
|
{ |
|
|
_computeLuminancePyramidPipeline = new Fsr2ComputeLuminancePyramidPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer, _spdConstantsBuffer); |
|
|
_computeLuminancePyramidPipeline = new Fsr2ComputeLuminancePyramidPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer, _spdConstantsBuffer); |
|
|
@ -77,6 +72,7 @@ namespace FidelityFX |
|
|
_accumulatePipeline = new Fsr2AccumulatePipeline(_contextDescription, _resources, _fsr2ConstantsBuffer); |
|
|
_accumulatePipeline = new Fsr2AccumulatePipeline(_contextDescription, _resources, _fsr2ConstantsBuffer); |
|
|
_accumulateSharpenPipeline = new Fsr2AccumulateSharpenPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer); |
|
|
_accumulateSharpenPipeline = new Fsr2AccumulateSharpenPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer); |
|
|
_rcasPipeline = new Fsr2RcasPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer, _rcasConstantsBuffer); |
|
|
_rcasPipeline = new Fsr2RcasPipeline(_contextDescription, _resources, _fsr2ConstantsBuffer, _rcasConstantsBuffer); |
|
|
|
|
|
_generateReactivePipeline = new Fsr2GenerateReactivePipeline(_contextDescription, _resources, _generateReactiveConstantsBuffer); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void Destroy() |
|
|
public void Destroy() |
|
|
@ -194,6 +190,25 @@ namespace FidelityFX |
|
|
Fsr2Pipeline.UnregisterResources(_commandBuffer); |
|
|
Fsr2Pipeline.UnregisterResources(_commandBuffer); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void GenerateReactiveMask(Fsr2.GenerateReactiveDescription dispatchParams) |
|
|
|
|
|
{ |
|
|
|
|
|
_commandBuffer.Clear(); |
|
|
|
|
|
|
|
|
|
|
|
const int threadGroupWorkRegionDim = 8; |
|
|
|
|
|
int dispatchSrcX = (dispatchParams.RenderSize.x + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
|
|
int dispatchSrcY = (dispatchParams.RenderSize.y + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; |
|
|
|
|
|
|
|
|
|
|
|
GenReactiveConsts.scale = dispatchParams.Scale; |
|
|
|
|
|
GenReactiveConsts.threshold = dispatchParams.CutoffThreshold; |
|
|
|
|
|
GenReactiveConsts.binaryValue = dispatchParams.BinaryValue; |
|
|
|
|
|
GenReactiveConsts.flags = dispatchParams.Flags; |
|
|
|
|
|
_generateReactiveConstantsBuffer.SetData(_generateReactiveConstantsArray); |
|
|
|
|
|
|
|
|
|
|
|
((Fsr2GenerateReactivePipeline)_generateReactivePipeline).ScheduleDispatch(_commandBuffer, dispatchParams, dispatchSrcX, dispatchSrcY); |
|
|
|
|
|
|
|
|
|
|
|
Graphics.ExecuteCommandBuffer(_commandBuffer); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void SetupConstants(Fsr2.DispatchDescription dispatchParams, bool resetAccumulation) |
|
|
private void SetupConstants(Fsr2.DispatchDescription dispatchParams, bool resetAccumulation) |
|
|
{ |
|
|
{ |
|
|
ref Fsr2.Fsr2Constants constants = ref Constants; |
|
|
ref Fsr2.Fsr2Constants constants = ref Constants; |
|
|
|