diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset index aba839f..835a2eb 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/PostProcessResources.asset @@ -127,20 +127,12 @@ MonoBehaviour: multiScaleAORender: {fileID: 7200000, guid: 34a460e8a2e66c243a9c12024e5a798d, type: 3} multiScaleAOUpsample: {fileID: 7200000, guid: 600d6212b59bb40409d19d750b5fd1e9, type: 3} gaussianDownsample: {fileID: 7200000, guid: 6dba4103d23a7904fbc49099355aff3e, type: 3} - namedShaders: - - name: FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass - shader: {fileID: 7200000, guid: d253be05abcdc80428503d3e4cce3a36, type: 3} - - name: FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass - shader: {fileID: 7200000, guid: 4f59e5b9179d74844ae06a30ae1e0629, type: 3} - - name: FSR3/ffx_fsr3upscaler_depth_clip_pass - shader: {fileID: 7200000, guid: 20e44016ed34b0d4b8de499d1b566c69, type: 3} - - name: FSR3/ffx_fsr3upscaler_lock_pass - shader: {fileID: 7200000, guid: a135306e6d1857e43a86ef20db2a47fe, type: 3} - - name: FSR3/ffx_fsr3upscaler_accumulate_pass - shader: {fileID: 7200000, guid: c9b45f0ae7673694ba57a4aadfe212e9, type: 3} - - name: FSR3/ffx_fsr3upscaler_rcas_pass - shader: {fileID: 7200000, guid: 7aaf5cfff022de2499e9b0412f947f6c, type: 3} - - name: FSR3/ffx_fsr3upscaler_autogen_reactive_pass - shader: {fileID: 7200000, guid: 5716b91fdaa4e9e439df6b96a796fe6e, type: 3} - - name: FSR3/ffx_fsr3upscaler_tcr_autogen_pass - shader: {fileID: 7200000, guid: 75cdc6ef23f08ed498d4da511923fcea, type: 3} + superResolution: + computeLuminancePyramidPass: {fileID: 7200000, guid: d253be05abcdc80428503d3e4cce3a36, type: 3} + reconstructPreviousDepthPass: {fileID: 7200000, guid: 4f59e5b9179d74844ae06a30ae1e0629, type: 3} + depthClipPass: {fileID: 7200000, guid: 20e44016ed34b0d4b8de499d1b566c69, type: 3} + lockPass: {fileID: 7200000, guid: a135306e6d1857e43a86ef20db2a47fe, type: 3} + accumulatePass: {fileID: 7200000, guid: c9b45f0ae7673694ba57a4aadfe212e9, type: 3} + sharpenPass: {fileID: 7200000, guid: 7aaf5cfff022de2499e9b0412f947f6c, type: 3} + autoGenReactivePass: {fileID: 7200000, guid: 5716b91fdaa4e9e439df6b96a796fe6e, type: 3} + tcrAutoGenPass: {fileID: 7200000, guid: 75cdc6ef23f08ed498d4da511923fcea, type: 3} diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs index c0e49c3..7c29eda 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs @@ -31,7 +31,7 @@ namespace UnityEngine.Rendering.PostProcessing [Serializable] public class SuperResolution { - public Func callbacksFactory { get; set; } = (context) => new Callbacks(context.resources); + public Func callbacksFactory { get; set; } = (context) => new Fsr3UpscalerCallbacksBase(); [Tooltip("Standard scaling ratio presets.")] public Fsr3Upscaler.QualityMode qualityMode = Fsr3Upscaler.QualityMode.Quality; @@ -211,7 +211,7 @@ namespace UnityEngine.Rendering.PostProcessing if (RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution; _callbacks = callbacksFactory(context); - _fsrContext = Fsr3Upscaler.CreateContext(_displaySize, _maxRenderSize, _callbacks, flags); + _fsrContext = Fsr3Upscaler.CreateContext(_displaySize, _maxRenderSize, context.resources.computeShaders.superResolution, _callbacks, flags); // Apply a mipmap bias so that textures retain their sharpness float biasOffset = Fsr3Upscaler.GetMipmapBiasOffset(_maxRenderSize.x, _displaySize.x); @@ -330,24 +330,5 @@ namespace UnityEngine.Rendering.PostProcessing return new Vector2Int(Mathf.CeilToInt(_maxRenderSize.x * ScalableBufferManager.widthScaleFactor), Mathf.CeilToInt(_maxRenderSize.y * ScalableBufferManager.heightScaleFactor)); } - - private class Callbacks : Fsr3UpscalerCallbacksBase - { - private readonly PostProcessResources _resources; - - public Callbacks(PostProcessResources resources) - { - _resources = resources; - } - - public override ComputeShader LoadComputeShader(string name) - { - return _resources.computeShaders.FindComputeShader(name); - } - - public override void UnloadComputeShader(ComputeShader shader) - { - } - } } } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs index 4c5dc51..90036d4 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3Upscaler.cs @@ -33,7 +33,7 @@ namespace FidelityFX /// /// Creates a new FSR3 Upscaler context with standard parameters that are appropriate for the current platform. /// - public static Fsr3UpscalerContext CreateContext(Vector2Int displaySize, Vector2Int maxRenderSize, IFsr3UpscalerCallbacks callbacks, InitializationFlags flags = 0) + public static Fsr3UpscalerContext CreateContext(Vector2Int displaySize, Vector2Int maxRenderSize, Fsr3UpscalerShaders shaders, IFsr3UpscalerCallbacks callbacks, InitializationFlags flags = 0) { if (SystemInfo.usesReversedZBuffer) flags |= InitializationFlags.EnableDepthInverted; @@ -51,6 +51,7 @@ namespace FidelityFX Flags = flags, DisplaySize = displaySize, MaxRenderSize = maxRenderSize, + Shaders = shaders, Callbacks = callbacks, }; @@ -166,6 +167,7 @@ namespace FidelityFX public InitializationFlags Flags; public Vector2Int MaxRenderSize; public Vector2Int DisplaySize; + public Fsr3UpscalerShaders Shaders; public IFsr3UpscalerCallbacks Callbacks; } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs index 01e974b..5b2c89c 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerCallbacks.cs @@ -28,9 +28,6 @@ namespace FidelityFX /// public interface IFsr3UpscalerCallbacks { - ComputeShader LoadComputeShader(string name); - void UnloadComputeShader(ComputeShader shader); - /// /// Apply a mipmap bias to in-game textures to prevent them from becoming blurry as the internal rendering resolution lowers. /// This will need to be customized on a per-game basis, as there is no clear universal way to determine what are "in-game" textures. @@ -52,16 +49,6 @@ namespace FidelityFX { protected float CurrentBiasOffset = 0; - public virtual ComputeShader LoadComputeShader(string name) - { - return Resources.Load(name); - } - - public virtual void UnloadComputeShader(ComputeShader shader) - { - Resources.UnloadAsset(shader); - } - public virtual void ApplyMipmapBias(float biasOffset) { if (float.IsNaN(biasOffset) || float.IsInfinity(biasOffset)) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs index 61722d5..da02d9f 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerContext.cs @@ -42,7 +42,7 @@ namespace FidelityFX private Fsr3UpscalerPass _reconstructPreviousDepthPass; private Fsr3UpscalerPass _lockPass; private Fsr3UpscalerPass _accumulatePass; - private Fsr3UpscalerPass _rcasPass; + private Fsr3UpscalerPass _sharpenPass; private Fsr3UpscalerPass _computeLuminancePyramidPass; private Fsr3UpscalerPass _generateReactivePass; private Fsr3UpscalerPass _tcrAutogeneratePass; @@ -101,7 +101,7 @@ namespace FidelityFX _depthClipPass = new Fsr3UpscalerDepthClipPass(_contextDescription, _resources, _upscalerConstantsBuffer); _lockPass = new Fsr3UpscalerLockPass(_contextDescription, _resources, _upscalerConstantsBuffer); _accumulatePass = new Fsr3UpscalerAccumulatePass(_contextDescription, _resources, _upscalerConstantsBuffer); - _rcasPass = new Fsr3UpscalerRcasPass(_contextDescription, _resources, _upscalerConstantsBuffer, _rcasConstantsBuffer); + _sharpenPass = new Fsr3UpscalerSharpenPass(_contextDescription, _resources, _upscalerConstantsBuffer, _rcasConstantsBuffer); _generateReactivePass = new Fsr3UpscalerGenerateReactivePass(_contextDescription, _resources, _generateReactiveConstantsBuffer); _tcrAutogeneratePass = new Fsr3UpscalerTcrAutogeneratePass(_contextDescription, _resources, _upscalerConstantsBuffer, _tcrAutogenerateConstantsBuffer); } @@ -111,7 +111,7 @@ namespace FidelityFX DestroyPass(ref _tcrAutogeneratePass); DestroyPass(ref _generateReactivePass); DestroyPass(ref _computeLuminancePyramidPass); - DestroyPass(ref _rcasPass); + DestroyPass(ref _sharpenPass); DestroyPass(ref _accumulatePass); DestroyPass(ref _lockPass); DestroyPass(ref _reconstructPreviousDepthPass); @@ -258,7 +258,7 @@ namespace FidelityFX const int threadGroupWorkRegionDimRcas = 16; int threadGroupsX = (Screen.width + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas; int threadGroupsY = (Screen.height + threadGroupWorkRegionDimRcas - 1) / threadGroupWorkRegionDimRcas; - _rcasPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, threadGroupsX, threadGroupsY); + _sharpenPass.ScheduleDispatch(commandBuffer, dispatchParams, frameIndex, threadGroupsX, threadGroupsY); } _resourceFrameIndex = (_resourceFrameIndex + 1) % MaxQueuedFrames; diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs index bb7f746..e1dc225 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerPass.cs @@ -50,26 +50,24 @@ namespace FidelityFX public virtual void Dispose() { - UnloadComputeShader(); } public abstract void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY); - protected void LoadComputeShader(string name) + protected void InitComputeShader(string passName, ComputeShader shader) { - LoadComputeShader(name, ContextDescription.Flags, ref ComputeShader, out KernelIndex); + InitComputeShader(passName, shader, ContextDescription.Flags); } - private void LoadComputeShader(string name, Fsr3Upscaler.InitializationFlags flags, ref ComputeShader shaderRef, out int kernelIndex) + private void InitComputeShader(string passName, ComputeShader shader, Fsr3Upscaler.InitializationFlags flags) { - if (shaderRef == null) + if (shader == null) { - shaderRef = ContextDescription.Callbacks.LoadComputeShader(name); - if (shaderRef == null) - throw new MissingReferenceException($"Shader '{name}' could not be loaded! Please ensure it is included in the project correctly."); + throw new MissingReferenceException($"Shader for FSR3 Upscaler '{passName}' could not be loaded! Please ensure it is included in the project correctly."); } - kernelIndex = shaderRef.FindKernel("CS"); + ComputeShader = shader; + KernelIndex = ComputeShader.FindKernel("CS"); bool useLut = false; #if UNITY_2022_1_OR_NEWER // This will also work in 2020.3.43+ and 2021.3.14+ @@ -80,34 +78,20 @@ namespace FidelityFX #endif // This matches the permutation rules from the CreatePipeline* functions - if ((flags & Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_HDR_COLOR_INPUT"); - if ((flags & Fsr3Upscaler.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS"); - if ((flags & Fsr3Upscaler.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS"); - if ((flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) != 0) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH"); - if (useLut) shaderRef.EnableKeyword("FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE"); - if ((flags & Fsr3Upscaler.InitializationFlags.EnableFP16Usage) != 0) shaderRef.EnableKeyword("FFX_HALF"); + if ((flags & Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange) != 0) ComputeShader.EnableKeyword("FFX_FSR3UPSCALER_OPTION_HDR_COLOR_INPUT"); + if ((flags & Fsr3Upscaler.InitializationFlags.EnableDisplayResolutionMotionVectors) == 0) ComputeShader.EnableKeyword("FFX_FSR3UPSCALER_OPTION_LOW_RESOLUTION_MOTION_VECTORS"); + if ((flags & Fsr3Upscaler.InitializationFlags.EnableMotionVectorsJitterCancellation) != 0) ComputeShader.EnableKeyword("FFX_FSR3UPSCALER_OPTION_JITTERED_MOTION_VECTORS"); + if ((flags & Fsr3Upscaler.InitializationFlags.EnableDepthInverted) != 0) ComputeShader.EnableKeyword("FFX_FSR3UPSCALER_OPTION_INVERTED_DEPTH"); + if (useLut) ComputeShader.EnableKeyword("FFX_FSR3UPSCALER_OPTION_REPROJECT_USE_LANCZOS_TYPE"); + if ((flags & Fsr3Upscaler.InitializationFlags.EnableFP16Usage) != 0) ComputeShader.EnableKeyword("FFX_HALF"); // Inform the shader which render pipeline we're currently using var pipeline = GraphicsSettings.currentRenderPipeline; if (pipeline != null && pipeline.GetType().Name.Contains("HDRenderPipeline")) { - shaderRef.EnableKeyword("UNITY_FSR3UPSCALER_HDRP"); + ComputeShader.EnableKeyword("UNITY_FSR3UPSCALER_HDRP"); } } - - private void UnloadComputeShader() - { - UnloadComputeShader(ref ComputeShader); - } - - private void UnloadComputeShader(ref ComputeShader shaderRef) - { - if (shaderRef == null) - return; - - ContextDescription.Callbacks.UnloadComputeShader(shaderRef); - shaderRef = null; - } } internal class Fsr3UpscalerComputeLuminancePyramidPass : Fsr3UpscalerPass @@ -119,7 +103,7 @@ namespace FidelityFX { _spdConstants = spdConstants; - LoadComputeShader("FSR3/ffx_fsr3upscaler_compute_luminance_pyramid_pass"); + InitComputeShader("compute_luminance_pyramid_pass", contextDescription.Shaders.computeLuminancePyramidPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -144,7 +128,7 @@ namespace FidelityFX public Fsr3UpscalerReconstructPreviousDepthPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants) : base(contextDescription, resources, constants) { - LoadComputeShader("FSR3/ffx_fsr3upscaler_reconstruct_previous_depth_pass"); + InitComputeShader("reconstruct_previous_depth_pass", contextDescription.Shaders.reconstructPreviousDepthPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -172,7 +156,7 @@ namespace FidelityFX public Fsr3UpscalerDepthClipPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants) : base(contextDescription, resources, constants) { - LoadComputeShader("FSR3/ffx_fsr3upscaler_depth_clip_pass"); + InitComputeShader("depth_clip_pass", contextDescription.Shaders.depthClipPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -207,7 +191,7 @@ namespace FidelityFX public Fsr3UpscalerLockPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants) : base(contextDescription, resources, constants) { - LoadComputeShader("FSR3/ffx_fsr3upscaler_lock_pass"); + InitComputeShader("lock_pass", contextDescription.Shaders.lockPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -230,7 +214,7 @@ namespace FidelityFX public Fsr3UpscalerAccumulatePass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants) : base(contextDescription, resources, constants) { - LoadComputeShader("FSR3/ffx_fsr3upscaler_accumulate_pass"); + InitComputeShader("accumulate_pass", contextDescription.Shaders.accumulatePass); #if UNITY_2021_2_OR_NEWER _sharpeningKeyword = new LocalKeyword(ComputeShader, SharpeningKeyword); #endif @@ -286,16 +270,16 @@ namespace FidelityFX } } - internal class Fsr3UpscalerRcasPass : Fsr3UpscalerPass + internal class Fsr3UpscalerSharpenPass : Fsr3UpscalerPass { private readonly ComputeBuffer _rcasConstants; - public Fsr3UpscalerRcasPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants, ComputeBuffer rcasConstants) + public Fsr3UpscalerSharpenPass(Fsr3Upscaler.ContextDescription contextDescription, Fsr3UpscalerResources resources, ComputeBuffer constants, ComputeBuffer rcasConstants) : base(contextDescription, resources, constants) { _rcasConstants = rcasConstants; - LoadComputeShader("FSR3/ffx_fsr3upscaler_rcas_pass"); + InitComputeShader("rcas_pass", contextDescription.Shaders.sharpenPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -323,7 +307,7 @@ namespace FidelityFX { _generateReactiveConstants = generateReactiveConstants; - LoadComputeShader("FSR3/ffx_fsr3upscaler_autogen_reactive_pass"); + InitComputeShader("autogen_reactive_pass", contextDescription.Shaders.autoGenReactivePass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) @@ -355,7 +339,7 @@ namespace FidelityFX { _tcrAutogenerateConstants = tcrAutogenerateConstants; - LoadComputeShader("FSR3/ffx_fsr3upscaler_tcr_autogen_pass"); + InitComputeShader("tcr_autogen_pass", contextDescription.Shaders.tcrAutoGenPass); } public override void ScheduleDispatch(CommandBuffer commandBuffer, Fsr3Upscaler.DispatchDescription dispatchParams, int frameIndex, int dispatchX, int dispatchY) diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs new file mode 100644 index 0000000..9d9fa4d --- /dev/null +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs @@ -0,0 +1,60 @@ +using System; +using UnityEngine; + +namespace FidelityFX +{ + /// + /// All the compute shaders used by the FidelityFX Super Resolution 3 (FSR3) Upscaler. + /// + [Serializable] + public class Fsr3UpscalerShaders + { + /// + /// 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(); + } + } +} diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs.meta b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs.meta new file mode 100644 index 0000000..d5531c2 --- /dev/null +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR3/Fsr3UpscalerShaders.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cec8f68d6b0d9be4986fac65d3a2e1a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessResources.cs b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessResources.cs index fb9e469..35293ef 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessResources.cs +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessResources.cs @@ -1,4 +1,5 @@ using System; +using FidelityFX; namespace UnityEngine.Rendering.PostProcessing { @@ -214,9 +215,9 @@ namespace UnityEngine.Rendering.PostProcessing public ComputeShader gaussianDownsample; /// - /// Compute shaders that need to be looked up by name. + /// Compute shaders used by the FidelityFX Super Resolution 3 (FSR3) Upscaler. /// - public NamedComputeShader[] namedShaders; + public Fsr3UpscalerShaders superResolution; /// /// Returns a copy of this class and its content. @@ -226,24 +227,6 @@ namespace UnityEngine.Rendering.PostProcessing { return (ComputeShaders)MemberwiseClone(); } - - public ComputeShader FindComputeShader(string name) - { - for (int i = 0; i < namedShaders.Length; ++i) - { - if (namedShaders[i].name == name) - return namedShaders[i].shader; - } - - return null; - } - } - - [Serializable] - public class NamedComputeShader - { - public string name; - public ComputeShader shader; } ///