|
|
@ -21,6 +21,7 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Runtime.InteropServices; |
|
|
using System.Runtime.InteropServices; |
|
|
using UnityEngine; |
|
|
using UnityEngine; |
|
|
|
|
|
using UnityEngine.Profiling; |
|
|
using UnityEngine.Rendering; |
|
|
using UnityEngine.Rendering; |
|
|
|
|
|
|
|
|
namespace FidelityFX.FSR3 |
|
|
namespace FidelityFX.FSR3 |
|
|
@ -65,6 +66,8 @@ namespace FidelityFX.FSR3 |
|
|
private Vector2 _previousJitterOffset; |
|
|
private Vector2 _previousJitterOffset; |
|
|
private float _preExposure; |
|
|
private float _preExposure; |
|
|
private float _previousFramePreExposure; |
|
|
private float _previousFramePreExposure; |
|
|
|
|
|
|
|
|
|
|
|
private readonly CustomSampler _sampler = CustomSampler.Create("FSR3 Upscaler"); |
|
|
|
|
|
|
|
|
public void Create(Fsr3Upscaler.ContextDescription contextDescription) |
|
|
public void Create(Fsr3Upscaler.ContextDescription contextDescription) |
|
|
{ |
|
|
{ |
|
|
@ -144,6 +147,8 @@ namespace FidelityFX.FSR3 |
|
|
|
|
|
|
|
|
public void Dispatch(Fsr3Upscaler.DispatchDescription dispatchParams, CommandBuffer commandBuffer) |
|
|
public void Dispatch(Fsr3Upscaler.DispatchDescription dispatchParams, CommandBuffer commandBuffer) |
|
|
{ |
|
|
{ |
|
|
|
|
|
commandBuffer.BeginSample(_sampler); |
|
|
|
|
|
|
|
|
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDebugChecking) != 0) |
|
|
if ((_contextDescription.Flags & Fsr3Upscaler.InitializationFlags.EnableDebugChecking) != 0) |
|
|
{ |
|
|
{ |
|
|
DebugCheckDispatch(dispatchParams); |
|
|
DebugCheckDispatch(dispatchParams); |
|
|
@ -281,6 +286,7 @@ namespace FidelityFX.FSR3 |
|
|
Fsr3UpscalerResources.DestroyAliasableResources(commandBuffer); |
|
|
Fsr3UpscalerResources.DestroyAliasableResources(commandBuffer); |
|
|
|
|
|
|
|
|
commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY"); |
|
|
commandBuffer.DisableShaderKeyword("UNITY_FSR_TEXTURE2D_X_ARRAY"); |
|
|
|
|
|
commandBuffer.EndSample(_sampler); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void GenerateReactiveMask(Fsr3Upscaler.GenerateReactiveDescription dispatchParams) |
|
|
public void GenerateReactiveMask(Fsr3Upscaler.GenerateReactiveDescription dispatchParams) |
|
|
|