diff --git a/Assets/Scripts/Fsr2Context.cs b/Assets/Scripts/Fsr2Context.cs index 8bba114..399443e 100644 --- a/Assets/Scripts/Fsr2Context.cs +++ b/Assets/Scripts/Fsr2Context.cs @@ -367,6 +367,30 @@ namespace FidelityFX private void DebugCheckDispatch(Fsr2.DispatchDescription dispatchParams) { + // Global texture binding may happen as part of the command list, which is why we check these after running the process at least once + if (!_firstExecution) + { + if (!dispatchParams.Color.HasValue && Shader.GetGlobalTexture(Fsr2Pipeline.SrvInputColor) == null) + { + Debug.LogError("Color resource is null"); + } + + if (!dispatchParams.Depth.HasValue && Shader.GetGlobalTexture(Fsr2Pipeline.SrvInputDepth) == null) + { + Debug.LogError("Depth resource is null"); + } + + if (!dispatchParams.MotionVectors.HasValue && Shader.GetGlobalTexture(Fsr2Pipeline.SrvInputMotionVectors) == null) + { + Debug.LogError("MotionVectors resource is null"); + } + + if (!dispatchParams.Output.HasValue && Shader.GetGlobalTexture(Fsr2Pipeline.UavUpscaledOutput) == null) + { + Debug.LogError("Output resource is null"); + } + } + if (dispatchParams.Exposure.HasValue && (_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0) { Debug.LogWarning("Exposure resource provided, however auto exposure flag is present");