From ab5498f47a9a9adefa84c2582510ee749c34aa16 Mon Sep 17 00:00:00 2001 From: StarBeats <977663818@qq.com> Date: Tue, 22 Apr 2025 14:53:13 +0800 Subject: [PATCH] fix gc --- Assets/Scenes/Garden/GardenScene.unity | 4 + Assets/Scenes/Test.cs | 12 +-- Assets/Settings/Mobile/Mobile_High.asset | 4 +- .../Mobile/Mobile_High_Renderer.asset | 14 ++- .../Runtime/Passes/PostProcessPass.cs | 2 +- .../Runtime/ScriptableRenderer.cs | 2 +- .../Runtime/SuperRendering/SR/Scripts/DLSS.cs | 4 +- .../Runtime/SuperRendering/SR/Scripts/FSR.cs | 10 +- .../Runtime/SuperRendering/SR/Scripts/GSR.cs | 16 ++-- .../SuperRendering/SR/Scripts/HuaweiSR.cs | 2 +- .../Runtime/SuperRendering/SR/Scripts/SR.cs | 93 ++++--------------- .../Runtime/SuperRendering/SR/Scripts/XESS.cs | 8 +- .../SuperRendering/SR/Scripts/XESS2.cs | 8 +- .../Runtime/SuperRendering/SRSettings.cs | 2 +- .../Runtime/TemporalAA.cs | 6 +- 15 files changed, 65 insertions(+), 122 deletions(-) diff --git a/Assets/Scenes/Garden/GardenScene.unity b/Assets/Scenes/Garden/GardenScene.unity index de1f0fe..ab1e487 100644 --- a/Assets/Scenes/Garden/GardenScene.unity +++ b/Assets/Scenes/Garden/GardenScene.unity @@ -47427,6 +47427,10 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 6968620290940108330, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7019485897165914674, guid: 8e5bed6b8dcfed240a38affefd9c58f6, type: 3} propertyPath: m_LocalPosition.x value: 0 diff --git a/Assets/Scenes/Test.cs b/Assets/Scenes/Test.cs index 01bfe56..35a27ce 100644 --- a/Assets/Scenes/Test.cs +++ b/Assets/Scenes/Test.cs @@ -84,8 +84,8 @@ public class Test : MonoBehaviour else { - SuperResolutionParamSets.Instance.Set("NeedJitter", false); - SuperResolutionParamSets.Instance.Set("MipmapBias", 0); + SuperResolutionParamSets.Set("NeedJitter", false); + SuperResolutionParamSets.Set("MipmapBias", 0); asset.superResolution = ESuperResolution.None; dlss.SetActive(false); } @@ -129,8 +129,8 @@ public class Test : MonoBehaviour } else { - SuperResolutionParamSets.Instance.Set("NeedJitter", false); - SuperResolutionParamSets.Instance.Set("MipmapBias", 0); + SuperResolutionParamSets.Set("NeedJitter", false); + SuperResolutionParamSets.Set("MipmapBias", 0); asset.superResolution = ESuperResolution.None; xess.SetSR(ESuperResolution.None); } @@ -199,8 +199,8 @@ public class Test : MonoBehaviour } else { - SuperResolutionParamSets.Instance.Set("NeedJitter", false); - SuperResolutionParamSets.Instance.Set("MipmapBias", 0); + SuperResolutionParamSets.Set("NeedJitter", false); + SuperResolutionParamSets.Set("MipmapBias", 0); asset.superResolution = ESuperResolution.None; hwsr.SetSR(ESuperResolution.None); } diff --git a/Assets/Settings/Mobile/Mobile_High.asset b/Assets/Settings/Mobile/Mobile_High.asset index 4605d3b..7adbc00 100644 --- a/Assets/Settings/Mobile/Mobile_High.asset +++ b/Assets/Settings/Mobile/Mobile_High.asset @@ -28,7 +28,7 @@ MonoBehaviour: m_SupportsHDR: 1 m_HDRColorBufferPrecision: 0 m_MSAA: 1 - m_RenderScale: 0.6666667 + m_RenderScale: 1 m_UpscalingFilter: 1 m_FsrOverrideSharpness: 1 m_FsrSharpness: 1 @@ -114,5 +114,5 @@ MonoBehaviour: m_PrefilterNativeRenderPass: 1 m_ShaderVariantLogLevel: 0 m_ShadowCascades: 0 - superResolution: 3 + superResolution: 5 vrsRate: 0 diff --git a/Assets/Settings/Mobile/Mobile_High_Renderer.asset b/Assets/Settings/Mobile/Mobile_High_Renderer.asset index 254c661..7b4417c 100644 --- a/Assets/Settings/Mobile/Mobile_High_Renderer.asset +++ b/Assets/Settings/Mobile/Mobile_High_Renderer.asset @@ -31,7 +31,6 @@ MonoBehaviour: useOptimalSetting: 0 sharpness: 0 preExposure: 0 - mipMapBias: 0 --- !u!114 &-7284859345190182597 MonoBehaviour: m_ObjectHideFlags: 0 @@ -44,7 +43,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 386e439eeef2849448d91896c74ff1d5, type: 3} m_Name: FSR m_EditorClassIdentifier: - m_Active: 1 + m_Active: 0 Quality: 1 v1setting: EasuCompute: {fileID: 7200000, guid: 787b0c165dad9074e9489817de945916, type: 3} @@ -137,17 +136,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a00dddc5b3ea7fe45953ccbd49b58b94, type: 3} m_Name: GSR m_EditorClassIdentifier: - m_Active: 0 - quality: 3 + m_Active: 1 + quality: 1 v1settings: EnableEdgeDirection: 1 Mode: 1 Sharp: 1.68 - MipMapBias: -0.35 GSRV1Material: {fileID: 2100000, guid: d57e64d5723127243b429034bed82c7d, type: 2} v2settings: - UseCompute2Pass: 1 - UseCompute3Pass: 1 + UseCompute2Pass: 0 + UseCompute3Pass: 0 GSRV2Material: {fileID: 2100000, guid: faa906817c0647f42a0cec70faeb91c1, type: 2} GSR2psComputeShader: {fileID: 7200000, guid: 9a4e6ff1f9a33fa4ea1e9744e313e2fd, type: 3} GSR3psComputeShader: {fileID: 7200000, guid: e1d5384c19bf4498b85b157bf0642a27, type: 3} @@ -404,7 +402,7 @@ MonoBehaviour: m_Name: XESS2 m_EditorClassIdentifier: m_Active: 0 - Quality: 106 + Quality: 104 --- !u!114 &4395980931634258890 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/Passes/PostProcessPass.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/Passes/PostProcessPass.cs index 82ed98f..4716cd1 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/Passes/PostProcessPass.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/Passes/PostProcessPass.cs @@ -302,7 +302,7 @@ namespace UnityEngine.Rendering.Universal { // Start by pre-fetching all builtin effect settings we need // Some of the color-grading settings are only used in the color grading lut pass - SuperResolutionParamSets.Instance.RenderContext = context; + SuperResolutionParamSets.RenderContext = context; var stack = VolumeManager.instance.stack; m_DepthOfField = stack.GetComponent(); m_MotionBlur = stack.GetComponent(); diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/ScriptableRenderer.cs index 9ac9daf..130262c 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/ScriptableRenderer.cs @@ -275,7 +275,7 @@ namespace UnityEngine.Rendering.Universal float mipBias = Math.Min((float)-Math.Log(cameraWidth / scaledCameraWidth, 2.0f), 0.0f); // Temporal Anti-aliasing can use negative mip bias to increase texture sharpness and new information for the jitter. float ssMipBias = 0; - SuperResolutionParamSets.Instance.Get("MipmapBias", ref ssMipBias); + SuperResolutionParamSets.Get("MipmapBias", ref ssMipBias); float taaMipBias = Math.Min(cameraData.taaSettings.mipBias, ssMipBias); mipBias = Math.Min(mipBias, taaMipBias); cmd.SetGlobalVector(ShaderPropertyId.globalMipBias, new Vector2(mipBias, Mathf.Pow(2.0f, mipBias))); diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/DLSS.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/DLSS.cs index d1dea0e..f051e20 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/DLSS.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/DLSS.cs @@ -164,8 +164,8 @@ namespace X.Rendering.Feature //biasColorMask = biasColorMask }; - SuperResolutionParamSets.Instance.Set("NeedJitter", true); - SuperResolutionParamSets.Instance.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, (int)outputWidth)); + SuperResolutionParamSets.Set("NeedJitter", true); + SuperResolutionParamSets.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, (int)outputWidth)); var jitter = TemporalAA.CurrentJitter; diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/FSR.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/FSR.cs index 51a3925..c29237a 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/FSR.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/FSR.cs @@ -289,7 +289,7 @@ namespace X.Rendering.Feature float inputH = source.referenceSize.y; float outputW = destination.referenceSize.x; float outputH = destination.referenceSize.y; - SuperResolutionParamSets.Instance.Set("MipmapBias", v1setting.MipMapBias); + SuperResolutionParamSets.Set("MipmapBias", v1setting.MipMapBias); // FIXME: vulkan 异常 cbFsr1Step1[0].const0 = new float4(inputW / outputW, inputH / outputH, 0.5f * inputW / outputW - 0.5f, 0.5f * inputH / outputH - 0.5f); @@ -410,8 +410,8 @@ namespace X.Rendering.Feature dispatchDescription.TransparencyAndComposition = new ResourceView(setting.TransparencyAndCompositionMask); } - SuperResolutionParamSets.Instance.Set("NeedJitter", true); - SuperResolutionParamSets.Instance.Set("MipmapBias", mipBias); + SuperResolutionParamSets.Set("NeedJitter", true); + SuperResolutionParamSets.Set("MipmapBias", mipBias); var jitter = TemporalAA.CurrentJitter; dispatchDescription.Output = new ResourceView(destination.rt); @@ -547,8 +547,8 @@ namespace X.Rendering.Feature mipBias = Fsr3Upscaler.GetMipmapBiasOffset(scaledRenderSize.x, upscaleSize.x); - SuperResolutionParamSets.Instance.Set("NeedJitter", true); - SuperResolutionParamSets.Instance.Set("MipmapBias", mipBias); + SuperResolutionParamSets.Set("NeedJitter", true); + SuperResolutionParamSets.Set("MipmapBias", mipBias); var jitter = TemporalAA.CurrentJitter; dispatchDescription.Output = new ResourceView(destination.rt); diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/GSR.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/GSR.cs index b1274a2..7c91483 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/GSR.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/GSR.cs @@ -197,7 +197,7 @@ namespace X.Rendering.Feature { v1settings.GSRV1Material.DisableKeyword("UseEdgeDirection"); } - SuperResolutionParamSets.Instance.Set("NeedJitter", false); + SuperResolutionParamSets.Set("NeedJitter", false); cmd.SetRenderTarget(destination); @@ -206,7 +206,7 @@ namespace X.Rendering.Feature cameraData.imageScalingMode = ImageScalingMode.None; cameraData.upscalingFilter = ImageUpscalingFilter.None; - SuperResolutionParamSets.Instance.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, cameraData.camera.pixelWidth)); + SuperResolutionParamSets.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, cameraData.camera.pixelWidth)); cmd.SetGlobalVector(ViewportInfoId, new Vector4(1.0f / pixW, 1.0f / pixH, pixW, pixH)); cmd.SetGlobalVector(GSR1ParamsId, new Vector4(v1settings.Mode, v1settings.Sharp, 0, 0)); @@ -279,7 +279,7 @@ namespace X.Rendering.Feature private void UpscalePass(CommandBuffer cmdBuffer, RTHandle source, RTHandle destination) { - SuperResolutionParamSets.Instance.Set("NeedJitter", true); + SuperResolutionParamSets.Set("NeedJitter", true); var jitter = TemporalAA.CurrentJitter; cmdBuffer.SetGlobalTexture("_PrevSceneColorTexture", prevSceneColorTexture1); @@ -321,7 +321,7 @@ namespace X.Rendering.Feature private void DispatchUpscale2ps(CommandBuffer cmdBuffer, RTHandle historyIn, RTHandle historyOut, RTHandle destination) { var compute = v2settings.GSR2psComputeShader; - SuperResolutionParamSets.Instance.Set("NeedJitter", true); + SuperResolutionParamSets.Set("NeedJitter", true); var jitter = TemporalAA.CurrentJitter; cmdBuffer.SetComputeTextureParam(compute, 1, "_inputPrevHistoryOutput", historyIn); cmdBuffer.SetComputeTextureParam(compute, 1, "_inputYCoCgColor", YCoCgColor); @@ -389,7 +389,7 @@ namespace X.Rendering.Feature private void DispatchUpscale3ps(CommandBuffer cmdBuffer, RTHandle historyIn, RTHandle historyOut, RTHandle destination) { var compute = v2settings.GSR3psComputeShader; - SuperResolutionParamSets.Instance.Set("NeedJitter", true); + SuperResolutionParamSets.Set("NeedJitter", true); var jitter = TemporalAA.CurrentJitter; cmdBuffer.SetComputeTextureParam(compute, 2, "UpscaleInYCoCgColor", YCoCgColor); @@ -493,7 +493,7 @@ namespace X.Rendering.Feature { width = camera.pixelWidth, height = camera.pixelHeight, - graphicsFormat = useCompute ? GraphicsFormat.R16G16B16A16_SFloat : GraphicsFormat.B10G11R11_UFloatPack32, + graphicsFormat = useCompute ? GraphicsFormat.R16G16B16A16_SFloat : source.rt.graphicsFormat, depthBufferBits = 0, enableRandomWrite = useCompute ? true : false, dimension = TextureDimension.Tex2D, @@ -503,13 +503,13 @@ namespace X.Rendering.Feature { width = camera.pixelWidth, height = camera.pixelHeight, - graphicsFormat = GraphicsFormat.R16G16B16A16_SFloat, + graphicsFormat = useCompute ? GraphicsFormat.R16G16B16A16_SFloat : source.rt.graphicsFormat, depthBufferBits = 0, enableRandomWrite = useCompute ? true : false, dimension = TextureDimension.Tex2D, msaaSamples = 1, }); - SuperResolutionParamSets.Instance.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, camera.pixelWidth)); + SuperResolutionParamSets.Set("MipmapBias", Fsr2.GetMipmapBiasOffset(source.referenceSize.x, camera.pixelWidth)); if (useCompute) { diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/HuaweiSR.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/HuaweiSR.cs index a3630bf..a031d75 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/HuaweiSR.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/HuaweiSR.cs @@ -47,7 +47,7 @@ namespace X.Rendering.Feature } using var scp = new ProfilingScope(cmd, profiler); - //SuperResolutionParamSets.Instance.Set("NeedJitter", true); + //SuperResolutionParamSets.Set("NeedJitter", true); if (superResolution == ESuperResolution.HW_SPATIAL_SR) { hwSpatialUpScale.DoSR(cmd, source, destination, motionVector, ref renderingData); diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/SR.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/SR.cs index 7f9059c..617f705 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/SR.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/SR.cs @@ -42,89 +42,30 @@ namespace X.Rendering.Feature UltraPerformance, } - public class SuperResolutionParamSets + public static class SuperResolutionParamSets { - private static SuperResolutionParamSets instance; - public static SuperResolutionParamSets Instance + public static ScriptableRenderContext RenderContext; + + internal class ParamSet { - get + public Dictionary paramMap = new(); + + private static ParamSet instance; + + public static ParamSet Instance => instance ??= new(); + } + + public static void Get(string name, ref T value) + { + if (!ParamSet.Instance.paramMap.TryGetValue(name, out value)) { - if (instance == null) - { - instance = new(); - } - return instance; + value = default(T); } } - public ScriptableRenderContext RenderContext; - - Dictionary boolMap = new (); - Dictionary intMap = new (); - Dictionary floatMap = new (); - Dictionary stringMap = new (); - - public void Get(string name, ref T value) + public static void Set(string name, in T value) { - switch (value) - { - case int v: - { - var map = intMap as Dictionary; - map.TryGetValue(name, out value); - break; - } - case float v: - { - var map = floatMap as Dictionary; - map.TryGetValue(name, out value); - break; - } - case string v: - { - var map = stringMap as Dictionary; - map.TryGetValue(name, out value); - break; - } - case bool v: - { - var map = boolMap as Dictionary; - map.TryGetValue(name, out value); - break; - } - default: - throw new ArgumentException($"type err:{typeof(T)}"); - } - } - - - public void Set(string name, in T value) - { - switch (value) - { - case int v: - { - intMap[name] = v; - break; - } - case float v: - { - floatMap[name] = v; - break; - } - case string v: - { - stringMap[name] = v; - break; - } - case bool v: - { - boolMap[name] = v; - break; - } - default: - throw new ArgumentException($"type err:{typeof(T)}"); - } + ParamSet.Instance.paramMap[name] = value; } } diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS.cs index 9d8d272..45ae5ea 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS.cs @@ -174,10 +174,10 @@ namespace X.Rendering.Feature return; } - SuperResolutionParamSets.Instance.Set("NeedJitter", true); - SuperResolutionParamSets.Instance.Set("MipmapBias", MipMapBias); - SuperResolutionParamSets.Instance.Set("JitterScale", xess1ConfigParam.JitterScaleX); - SuperResolutionParamSets.Instance.Set("AntiGhosting", antiGhosting); + SuperResolutionParamSets.Set("NeedJitter", true); + SuperResolutionParamSets.Set("MipmapBias", MipMapBias); + SuperResolutionParamSets.Set("JitterScale", xess1ConfigParam.JitterScaleX); + SuperResolutionParamSets.Set("AntiGhosting", antiGhosting); var jitter = TemporalAA.CurrentJitter; diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS2.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS2.cs index 053300b..08cf8c6 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS2.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SR/Scripts/XESS2.cs @@ -110,8 +110,8 @@ namespace X.Rendering.Feature lastQuality = Quality; } - SuperResolutionParamSets.Instance.Set("NeedJitter", true); - SuperResolutionParamSets.Instance.Set("MipmapBias", mipBias); + SuperResolutionParamSets.Set("NeedJitter", true); + SuperResolutionParamSets.Set("MipmapBias", mipBias); var jitter = TemporalAA.CurrentJitter; @@ -179,8 +179,8 @@ namespace X.Rendering.Feature default: { SetActive(false); - SuperResolutionParamSets.Instance.Set("NeedJitter", false); - SuperResolutionParamSets.Instance.Set("MipmapBias", 0); + SuperResolutionParamSets.Set("NeedJitter", false); + SuperResolutionParamSets.Set("MipmapBias", 0); if(xessContext != null && xessContext.context != IntPtr.Zero) { XeSS.xessDestroyContext(xessContext); diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SRSettings.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SRSettings.cs index 992079d..2c82988 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SRSettings.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/SuperRendering/SRSettings.cs @@ -36,7 +36,7 @@ namespace UnityEngine.Rendering.Universal if (!hasActive) { superResolution = ESuperResolution.None; - SuperResolutionParamSets.Instance.Set("NeedJitter", false); + SuperResolutionParamSets.Set("NeedJitter", false); } else { diff --git a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/TemporalAA.cs b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/TemporalAA.cs index 6a5c1cd..8c75608 100644 --- a/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/TemporalAA.cs +++ b/Packages/com.unity.render-pipelines.universal@14.0.11/Runtime/TemporalAA.cs @@ -302,7 +302,7 @@ namespace UnityEngine.Rendering.Universal { Matrix4x4 jitterMat = Matrix4x4.identity; bool needJitter = false; - SuperResolutionParamSets.Instance.Get("NeedJitter", ref needJitter); + SuperResolutionParamSets.Get("NeedJitter", ref needJitter); bool isJitter = cameraData.IsTemporalAAEnabled() || needJitter; jitter = Vector2.zero; @@ -314,7 +314,7 @@ namespace UnityEngine.Rendering.Universal float actualWidth = cameraData.cameraTargetDescriptor.width; float actualHeight = cameraData.cameraTargetDescriptor.height; float srJitterScale = 0; - SuperResolutionParamSets.Instance.Get("JitterScale", ref srJitterScale); + SuperResolutionParamSets.Get("JitterScale", ref srJitterScale); float jitterScale = Mathf.Max(cameraData.taaSettings.jitterScale, srJitterScale); jitter = CalculateJitter(taaFrameIndex) * jitterScale; @@ -342,7 +342,7 @@ namespace UnityEngine.Rendering.Universal float jitterX = HaltonSequence.Get((frameIndex & 1023) + 1, 2) - 0.5f; float jitterY = HaltonSequence.Get((frameIndex & 1023) + 1, 3) - 0.5f; float antiGhosting = 0; - SuperResolutionParamSets.Instance.Get("AntiGhosting", ref antiGhosting); + SuperResolutionParamSets.Get("AntiGhosting", ref antiGhosting); if (antiGhosting > 0.0f) {