Browse Source

Changed prebaked RCAS configurations into an array, as there is no need for a dynamically sized list here.

fsr2
Nico de Poel 2 years ago
parent
commit
05db2a9c39
  1. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Context.cs

4
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/FSR2/Fsr2Context.cs

@ -395,7 +395,7 @@ namespace FidelityFX
private void SetupRcasConstants(Fsr2.DispatchDescription dispatchParams) private void SetupRcasConstants(Fsr2.DispatchDescription dispatchParams)
{ {
int sharpnessIndex = Mathf.RoundToInt(Mathf.Clamp01(dispatchParams.Sharpness) * (RcasConfigs.Count - 1));
int sharpnessIndex = Mathf.RoundToInt(Mathf.Clamp01(dispatchParams.Sharpness) * (RcasConfigs.Length - 1));
RcasConsts = RcasConfigs[sharpnessIndex]; RcasConsts = RcasConfigs[sharpnessIndex];
} }
@ -532,7 +532,7 @@ namespace FidelityFX
/// The FSR2 C++ codebase uses floats bitwise converted to ints to pass sharpness parameters to the RCAS shader. /// The FSR2 C++ codebase uses floats bitwise converted to ints to pass sharpness parameters to the RCAS shader.
/// This is not possible in C# without enabling unsafe code compilation, so to avoid that we instead use a table of precomputed values. /// This is not possible in C# without enabling unsafe code compilation, so to avoid that we instead use a table of precomputed values.
/// </summary> /// </summary>
private static readonly List<Fsr2.RcasConstants> RcasConfigs = new List<Fsr2.RcasConstants>()
private static readonly Fsr2.RcasConstants[] RcasConfigs = new []
{ {
new Fsr2.RcasConstants(1048576000u, 872428544u), new Fsr2.RcasConstants(1048576000u, 872428544u),
new Fsr2.RcasConstants(1049178080u, 877212745u), new Fsr2.RcasConstants(1049178080u, 877212745u),

Loading…
Cancel
Save