Browse Source

Use implicit register binding when using UAVs in fragment shaders. Fixes remaining issues with reconstruct and accumulate passes on PS5 CGGC.

Also disable writing to locks UAV at the end of Accumulate pass, as it doesn't actually do anything and it might cause issues with reading & writing to the same texture.
asr-console
Nico de Poel 11 months ago
parent
commit
c52a40f706
  1. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_accumulate.h
  2. 6
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_callbacks_hlsl.h

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_accumulate.h

@ -372,7 +372,7 @@ AccumulateOutputs Accumulate(FfxInt32x2 iPxHrPos)
#if FFXM_FSR2_OPTION_APPLY_SHARPENING == 0 #if FFXM_FSR2_OPTION_APPLY_SHARPENING == 0
results.fColor = fHistoryColor; results.fColor = fHistoryColor;
#endif #endif
StoreNewLocks(iPxHrPos, 0);
//StoreNewLocks(iPxHrPos, 0);
return results; return results;
} }

6
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_callbacks_hlsl.h

@ -379,7 +379,7 @@ SamplerState s_LinearClamp : register(s1);
// UAV declarations // UAV declarations
#if defined FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH #if defined FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH
#if defined(SHADER_API_PSSL)
#if defined(SHADER_API_PSSL) && defined(SHADER_STAGE_FRAGMENT)
RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth; // Need to use implicit register binding for random write targets on PS4/5 RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth; // Need to use implicit register binding for random write targets on PS4/5
#else #else
RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH); RWTexture2D<FfxUInt32> rw_reconstructed_previous_nearest_depth : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_RECONSTRUCTED_PREV_NEAREST_DEPTH);
@ -401,7 +401,11 @@ SamplerState s_LinearClamp : register(s1);
RWTexture2D<FfxFloat32> rw_lock_input_luma : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_LOCK_INPUT_LUMA); RWTexture2D<FfxFloat32> rw_lock_input_luma : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_LOCK_INPUT_LUMA);
#endif #endif
#if defined FSR2_BIND_UAV_NEW_LOCKS #if defined FSR2_BIND_UAV_NEW_LOCKS
#if defined(SHADER_API_PSSL) && defined(SHADER_STAGE_FRAGMENT)
RWTexture2D<unorm FfxFloat32> rw_new_locks; // Need to use implicit register binding for random write targets on PS4/5
#else
RWTexture2D<unorm FfxFloat32> rw_new_locks : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_NEW_LOCKS); RWTexture2D<unorm FfxFloat32> rw_new_locks : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_NEW_LOCKS);
#endif
#endif #endif
#if defined FSR2_BIND_UAV_PREPARED_INPUT_COLOR #if defined FSR2_BIND_UAV_PREPARED_INPUT_COLOR
RWTexture2D<FfxFloat32x4> rw_prepared_input_color : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_PREPARED_INPUT_COLOR); RWTexture2D<FfxFloat32x4> rw_prepared_input_color : FFXM_FSR2_DECLARE_UAV(FSR2_BIND_UAV_PREPARED_INPUT_COLOR);

Loading…
Cancel
Save