|
|
|
@ -56,6 +56,41 @@ namespace FidelityFX |
|
|
|
{ |
|
|
|
return (Fsr3UpscalerShaders)MemberwiseClone(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns a copy of this class with clones of all its shaders.
|
|
|
|
/// This can be useful if you're running multiple FSR3 Upscaler instances with different shader configurations.
|
|
|
|
/// Be sure to clean up these clones through Dispose once you're done with them.
|
|
|
|
/// </summary>
|
|
|
|
public Fsr3UpscalerShaders DeepCopy() |
|
|
|
{ |
|
|
|
Fsr3UpscalerShaders copy = CreateInstance<Fsr3UpscalerShaders>(); |
|
|
|
copy.computeLuminancePyramidPass = Instantiate(computeLuminancePyramidPass); |
|
|
|
copy.reconstructPreviousDepthPass = Instantiate(reconstructPreviousDepthPass); |
|
|
|
copy.depthClipPass = Instantiate(depthClipPass); |
|
|
|
copy.lockPass = Instantiate(lockPass); |
|
|
|
copy.accumulatePass = Instantiate(accumulatePass); |
|
|
|
copy.sharpenPass = Instantiate(sharpenPass); |
|
|
|
copy.autoGenReactivePass = Instantiate(autoGenReactivePass); |
|
|
|
copy.tcrAutoGenPass = Instantiate(tcrAutoGenPass); |
|
|
|
return copy; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Destroy all the shaders within this instance.
|
|
|
|
/// Use this only on clones created through DeepCopy.
|
|
|
|
/// </summary>
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
Destroy(computeLuminancePyramidPass); |
|
|
|
Destroy(reconstructPreviousDepthPass); |
|
|
|
Destroy(depthClipPass); |
|
|
|
Destroy(lockPass); |
|
|
|
Destroy(accumulatePass); |
|
|
|
Destroy(sharpenPass); |
|
|
|
Destroy(autoGenReactivePass); |
|
|
|
Destroy(tcrAutoGenPass); |
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
private void Reset() |
|
|
|
|