From da270aef75c82f2a8be3f9a88edadd41b0a3dd35 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sat, 9 Nov 2024 15:55:05 +0100 Subject: [PATCH] Ported back a few fixes from Isonzo: - Detect if the native plugin is missing, in which case the upscaler won't be initialized. - Use the transparency & composition mask as input for the reactive mask initially. --- .../Runtime/Effects/Upscaling/PSSRUpscaler.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs index 2df8cb1..1508794 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/PSSRUpscaler.cs @@ -25,10 +25,20 @@ namespace UnityEngine.Rendering.PostProcessing static PSSRUpscaler() { - if (PSSRPlugin.InitPssr() < 0) + try { - Debug.LogError("Failed to initialize PSSR plugin!"); + if (PSSRPlugin.InitPssr() < 0) + { + Debug.LogError("Failed to initialize PSSR plugin!"); + PluginInitialized = false; + return; + } + } + catch (DllNotFoundException) + { + Debug.LogError("PSSR plugin not found!"); PluginInitialized = false; + return; } PluginInitialized = true; @@ -125,7 +135,7 @@ namespace UnityEngine.Rendering.PostProcessing // We need to provide copies of the previous depth and motion vector buffers anyway, so we can turn this otherwise wasteful copying into a benefit PrepareInputs(cmd, context, config, _inputColor, _inputDepth[frameIndex], _inputMotionVectors[frameIndex]); - Texture reactiveMask = config.reactiveMask; + Texture reactiveMask = config.transparencyAndCompositionMask; if (config.autoGenerateReactiveMask || config.autoGenerateTransparencyAndComposition) { reactiveMask = GenerateReactiveMask(cmd, context, config);