From 564bd71f5aa5d6af9767842b036a543b56108032 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Fri, 29 Sep 2023 16:58:29 +0200 Subject: [PATCH] Added a workaround for the missing SetBufferData method in Unity 2020.x, which was still named SetComputeBufferData there. --- Assets/Scripts/Core/Fsr2.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/Scripts/Core/Fsr2.cs b/Assets/Scripts/Core/Fsr2.cs index 772cfc3..51caa32 100644 --- a/Assets/Scripts/Core/Fsr2.cs +++ b/Assets/Scripts/Core/Fsr2.cs @@ -125,6 +125,13 @@ namespace FidelityFX return Mathf.Abs(value) < Mathf.Epsilon ? 1.0f : Mathf.Sin(Mathf.PI * value) / (Mathf.PI * value) * (Mathf.Sin(0.5f * Mathf.PI * value) / (0.5f * Mathf.PI * value)); } +#if !UNITY_2021_1_OR_NEWER + internal static void SetBufferData(this CommandBuffer commandBuffer, ComputeBuffer computeBuffer, Array data) + { + commandBuffer.SetComputeBufferData(computeBuffer, data); + } +#endif + public enum QualityMode { UltraQuality = 0,