From 53e8164f0e903165d3ae6203ce99a3f00d2b6dae Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 24 May 2023 15:38:13 +0200 Subject: [PATCH] Clear the atomic counter used by the luminance pyramid pass. This fixes auto-exposure being broken and causing a black screen on some platforms (Xbox, OpenGL). --- Assets/Scripts/Core/Fsr2Context.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Scripts/Core/Fsr2Context.cs b/Assets/Scripts/Core/Fsr2Context.cs index 890285d..8a6ea50 100644 --- a/Assets/Scripts/Core/Fsr2Context.cs +++ b/Assets/Scripts/Core/Fsr2Context.cs @@ -210,6 +210,10 @@ namespace FidelityFX commandBuffer.ClearRenderTarget(false, true, new Color(-1f, 1e8f, 0f, 0f)); } + // Reset atomic counter to 0 + commandBuffer.SetRenderTarget(Fsr2ShaderIDs.UavSpdAtomicCount); + commandBuffer.ClearRenderTarget(false, true, Color.clear); + // Auto exposure SetupSpdConstants(dispatchParams, out var dispatchThreadGroupCount);