From 16cf41493a7da3e2f3a8b83a699159803ee105cd Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 25 Mar 2025 13:11:33 +0100 Subject: [PATCH] Swapped the order of the render targets around for the depth clip pass. Fixes prepared input color being black in NGGC because... I don't know, probably an alignment issue of some sort? PS5 is being really stupid here. --- .../Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs | 4 ++-- .../ASR/Shaders/shaders/ffxm_fsr2_depth_clip_pass_fs.hlsl | 6 +++--- .../ASR/Shaders/shaders/fsr2/ffxm_fsr2_depth_clip.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs index f8ef944..4ad1628 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs @@ -215,8 +215,8 @@ namespace ArmASR commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvDilatedDepth, AsrShaderIDs.UavDilatedDepth); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvPrevDilatedMotionVectors, Resources.DilatedMotionVectors[frameIndex ^ 1]); - _mrt[0] = AsrShaderIDs.RtDilatedReactiveMasks; // fDilatedReactiveMasks - _mrt[1] = AsrShaderIDs.RtPreparedInputColor; // fTonemapped + _mrt[0] = AsrShaderIDs.RtPreparedInputColor; // fTonemapped + _mrt[1] = AsrShaderIDs.RtDilatedReactiveMasks; // fDilatedReactiveMasks FragmentProperties.SetConstantBuffer(AsrShaderIDs.CbFsr2, Constants, 0, Constants.stride); BlitFragment(commandBuffer, _mrt); diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/ffxm_fsr2_depth_clip_pass_fs.hlsl b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/ffxm_fsr2_depth_clip_pass_fs.hlsl index 86f042a..dd80fa0 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/ffxm_fsr2_depth_clip_pass_fs.hlsl +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/ffxm_fsr2_depth_clip_pass_fs.hlsl @@ -52,8 +52,8 @@ struct DepthClipOutputsFS { - FfxFloat32x2 fDilatedReactiveMasks : SV_TARGET0; - FfxFloat32x4 fTonemapped : SV_TARGET1; + FfxFloat32x4 fTonemapped : SV_TARGET0; + FfxFloat32x2 fDilatedReactiveMasks : SV_TARGET1; }; DepthClipOutputsFS main(float4 SvPosition : SV_POSITION) @@ -61,7 +61,7 @@ DepthClipOutputsFS main(float4 SvPosition : SV_POSITION) uint2 uPixelCoord = uint2(SvPosition.xy); DepthClipOutputs result = DepthClip(uPixelCoord); DepthClipOutputsFS output = (DepthClipOutputsFS)0; - output.fDilatedReactiveMasks = result.fDilatedReactiveMasks; output.fTonemapped = result.fTonemapped; + output.fDilatedReactiveMasks = result.fDilatedReactiveMasks; return output; } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_depth_clip.h b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_depth_clip.h index 2ef4152..0b4a00d 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_depth_clip.h +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_depth_clip.h @@ -27,8 +27,8 @@ struct DepthClipOutputs { - FfxFloat32x2 fDilatedReactiveMasks; FfxFloat32x4 fTonemapped; + FfxFloat32x2 fDilatedReactiveMasks; }; FFXM_STATIC const FfxFloat32 DepthClipBaseScale = 4.0f;