Browse Source

Moved nasty texture array keyword business into the dispatch logic and exposed it as a simple boolean parameter.

master
Nico de Poel 2 years ago
parent
commit
60f1f1ea37
  1. 1
      Runtime/FSR2/Fsr2.cs
  2. 5
      Runtime/FSR2/Fsr2Context.cs
  3. 1
      Runtime/FSR3/Fsr3Upscaler.cs
  4. 5
      Runtime/FSR3/Fsr3UpscalerContext.cs

1
Runtime/FSR2/Fsr2.cs

@ -194,6 +194,7 @@ namespace FidelityFX
public float CameraFar;
public float CameraFovAngleVertical;
public float ViewSpaceToMetersFactor;
public bool UseTextureArrays; // Enable texture array bindings, primarily used for HDRP and XR
// EXPERIMENTAL reactive mask generation parameters
public bool EnableAutoReactive;

5
Runtime/FSR2/Fsr2Context.cs

@ -146,6 +146,9 @@ namespace FidelityFX
DebugCheckDispatch(dispatchParams);
}
if (dispatchParams.UseTextureArrays)
commandBuffer.EnableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
if (_firstExecution)
{
commandBuffer.SetRenderTarget(_resources.LockStatus[0]);
@ -267,6 +270,8 @@ namespace FidelityFX
_resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames;
Fsr2Resources.DestroyAliasableResources(commandBuffer);
commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
}
public void GenerateReactiveMask(Fsr2.GenerateReactiveDescription dispatchParams)

1
Runtime/FSR3/Fsr3Upscaler.cs

@ -201,6 +201,7 @@ namespace FidelityFX
public float CameraFovAngleVertical;
public float ViewSpaceToMetersFactor;
public DispatchFlags Flags;
public bool UseTextureArrays; // Enable texture array bindings, primarily used for HDRP and XR
// EXPERIMENTAL reactive mask generation parameters
public bool EnableAutoReactive;

5
Runtime/FSR3/Fsr3UpscalerContext.cs

@ -162,6 +162,9 @@ namespace FidelityFX
{
DebugCheckDispatch(dispatchParams);
}
if (dispatchParams.UseTextureArrays)
commandBuffer.EnableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
if (_firstExecution)
{
@ -288,6 +291,8 @@ namespace FidelityFX
_resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames;
Fsr3UpscalerResources.DestroyAliasableResources(commandBuffer);
commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY");
}
public void GenerateReactiveMask(Fsr3Upscaler.GenerateReactiveDescription dispatchParams)

Loading…
Cancel
Save