using System;
using UnityEngine;
namespace FidelityFX
{
///
/// All the compute shaders used by the FidelityFX Super Resolution 3 (FSR3) Upscaler.
///
[Serializable]
public class Fsr3UpscalerShaders: ScriptableObject
{
///
/// The compute shader used by the luminance pyramid computation pass.
///
public ComputeShader computeLuminancePyramidPass;
///
/// The compute shader used by the previous depth reconstruction pass.
///
public ComputeShader reconstructPreviousDepthPass;
///
/// The compute shader used by the depth clip pass.
///
public ComputeShader depthClipPass;
///
/// The compute shader used by the lock pass.
///
public ComputeShader lockPass;
///
/// The compute shader used by the accumulation pass.
///
public ComputeShader accumulatePass;
///
/// The compute shader used by the RCAS sharpening pass.
///
public ComputeShader sharpenPass;
///
/// The compute shader used to auto-generate a reactive mask.
///
public ComputeShader autoGenReactivePass;
///
/// The compute shader used to auto-generate a transparency & composition mask.
///
public ComputeShader tcrAutoGenPass;
///
/// Returns a copy of this class and its contents.
///
public Fsr3UpscalerShaders Clone()
{
return (Fsr3UpscalerShaders)MemberwiseClone();
}
#if UNITY_EDITOR
private void Reset()
{
computeLuminancePyramidPass = FindComputeShader("ffx_fsr3upscaler_compute_luminance_pyramid_pass");
reconstructPreviousDepthPass = FindComputeShader("ffx_fsr3upscaler_reconstruct_previous_depth_pass");
depthClipPass = FindComputeShader("ffx_fsr3upscaler_depth_clip_pass");
lockPass = FindComputeShader("ffx_fsr3upscaler_lock_pass");
accumulatePass = FindComputeShader("ffx_fsr3upscaler_accumulate_pass");
sharpenPass = FindComputeShader("ffx_fsr3upscaler_rcas_pass");
autoGenReactivePass = FindComputeShader("ffx_fsr3upscaler_autogen_reactive_pass");
tcrAutoGenPass = FindComputeShader("ffx_fsr3upscaler_tcr_autogen_pass");
}
private static ComputeShader FindComputeShader(string name)
{
string[] assets = UnityEditor.AssetDatabase.FindAssets($"t:ComputeShader {name}");
if (assets == null || assets.Length == 0)
return null;
string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(assets[0]);
return UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath);
}
#endif
}
}