From 760003744f7e782fccd7923ba811a1db3dceb4b1 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 25 Mar 2025 20:55:17 +0100 Subject: [PATCH] Added missing bits of temporal reactive implementation in the FP32 code path, and only bind the relevant inputs to the Accumulate shader based on the ASR mode. Fixes Balanced and Performance modes on Xbox One, which for some reason still seems to be running the FP32 code path, no matter what the FFXM_HALF keyword is set to. --- .../Runtime/Effects/Upscaling/ASR/Runtime/AsrPass.cs | 6 ++++-- .../ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h | 4 ++++ 2 files changed, 8 insertions(+), 2 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 365f47a..505d251 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 @@ -255,18 +255,20 @@ namespace ArmASR commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvUpscaleMaximumBiasLut, Resources.MaximumBiasLut); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvSceneLuminanceMips, Resources.SceneLuminance); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvAutoExposure, Resources.AutoExposure[frameIndex]); - commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]); - commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvInternalTemporalReactive, Resources.InternalReactive[frameIndex ^ 1]); commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvNewLocks, AsrShaderIDs.UavNewLocks); if (ContextDescription.Variant == Asr.Variant.Quality) { + commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvLumaHistory, Resources.LumaHistory[frameIndex ^ 1]); + _mrt[0] = Resources.InternalUpscaled[frameIndex]; // fColorAndWeight _mrt[1] = Resources.LockStatus[frameIndex]; // fLockStatus _mrt[2] = Resources.LumaHistory[frameIndex]; // fLumaHistory } else { + commandBuffer.SetGlobalTexture(AsrShaderIDs.SrvInternalTemporalReactive, Resources.InternalReactive[frameIndex ^ 1]); + _mrt[0] = Resources.InternalUpscaled[frameIndex]; // fUpscaledColor _mrt[1] = Resources.InternalReactive[frameIndex]; // fTemporalReactive _mrt[2] = Resources.LockStatus[frameIndex]; // fLockStatus diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h index b6d20b6..b8b4c24 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/shaders/fsr2/ffxm_fsr2_reproject.h @@ -324,7 +324,11 @@ void ReprojectHistoryColor(const AccumulationPassCommonParams params, FFXM_PARAM #endif //Compute temporal reactivity info +#if FFXM_SHADER_QUALITY_OPT_SEPARATE_TEMPORAL_REACTIVE + fTemporalReactiveFactor = ffxSaturate(abs(SampleTemporalReactive(params.fReprojectedHrUv))); +#else fTemporalReactiveFactor = ffxSaturate(abs(fHistory.w)); +#endif bInMotionLastFrame = (fHistory.w < 0.0f); }