Browse Source

Added debug checks for input and output resources, either through direct assignment or through existing global texture bindings.

mac-autoexp
Nico de Poel 3 years ago
parent
commit
9b83409c71
  1. 24
      Assets/Scripts/Fsr2Context.cs

24
Assets/Scripts/Fsr2Context.cs

@ -367,6 +367,30 @@ namespace FidelityFX
private void DebugCheckDispatch(Fsr2.DispatchDescription dispatchParams) 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) if (dispatchParams.Exposure.HasValue && (_contextDescription.Flags & Fsr2.InitializationFlags.EnableAutoExposure) != 0)
{ {
Debug.LogWarning("Exposure resource provided, however auto exposure flag is present"); Debug.LogWarning("Exposure resource provided, however auto exposure flag is present");

Loading…
Cancel
Save