From e577240354f070e11937f1ec39a071522a25c8b8 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 6 Jul 2023 10:25:02 +0200 Subject: [PATCH] Reset atomic counter on any kind of reset, not just on first execution. Fixes black screen on Metal when doing a history reset. --- Assets/Scripts/Core/Fsr2Context.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Core/Fsr2Context.cs b/Assets/Scripts/Core/Fsr2Context.cs index c8b17c1..64ca979 100644 --- a/Assets/Scripts/Core/Fsr2Context.cs +++ b/Assets/Scripts/Core/Fsr2Context.cs @@ -150,10 +150,6 @@ namespace FidelityFX commandBuffer.ClearRenderTarget(false, true, Color.clear); commandBuffer.SetRenderTarget(_resources.LockStatus[1]); commandBuffer.ClearRenderTarget(false, true, Color.clear); - - // Reset atomic counter to 0 - commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter); - commandBuffer.ClearRenderTarget(false, true, Color.clear); } int frameIndex = _resourceFrameIndex % 2; @@ -209,6 +205,10 @@ namespace FidelityFX // Auto exposure always used to track luma changes in locking logic commandBuffer.SetRenderTarget(_resources.AutoExposure); commandBuffer.ClearRenderTarget(false, true, new Color(-1f, 1e8f, 0f, 0f)); + + // Reset atomic counter to 0 + commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter); + commandBuffer.ClearRenderTarget(false, true, Color.clear); } // Auto exposure