From c65cab824e50285c8c1565ac9ed490692ae9ff49 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 6 Jul 2023 15:09:43 +0200 Subject: [PATCH] Clear auto-exposure texture using zeroes on Metal. Should fix black screen flashes on accumulation reset, when auto-exposure is enabled. --- Assets/Scripts/Core/Fsr2Context.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Core/Fsr2Context.cs b/Assets/Scripts/Core/Fsr2Context.cs index 64ca979..cb67355 100644 --- a/Assets/Scripts/Core/Fsr2Context.cs +++ b/Assets/Scripts/Core/Fsr2Context.cs @@ -204,7 +204,7 @@ 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)); + commandBuffer.ClearRenderTarget(false, true, SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal ? Color.clear : new Color(-1f, 1e8f, 0f, 0f)); // Reset atomic counter to 0 commandBuffer.SetRenderTarget(_resources.SpdAtomicCounter);