Browse Source

Removed the FP16 option from the frontends, as it's causing inexplicable issues on certain hardware/driver combinations.

master
Nico de Poel 2 years ago
parent
commit
2ccb05437a
  1. 4
      Assets/Scripts/Fsr3UpscalerImageEffect.cs
  2. 3
      Packages/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs
  3. 4
      Packages/com.unity.postprocessing/PostProcessing/Runtime/Effects/SuperResolution.cs
  4. 3
      README.md

4
Assets/Scripts/Fsr3UpscalerImageEffect.cs

@ -44,9 +44,6 @@ namespace FidelityFX
[Tooltip("Strength of the sharpening effect.")] [Tooltip("Strength of the sharpening effect.")]
[Range(0, 1)] public float sharpness = 0.8f; [Range(0, 1)] public float sharpness = 0.8f;
[Tooltip("Allow the use of half precision compute operations, potentially improving performance if the platform supports it.")]
public bool enableFP16 = false;
[Header("Exposure")] [Header("Exposure")]
[Tooltip("Allow an exposure value to be computed internally. When set to false, either the provided exposure texture or a default exposure value will be used.")] [Tooltip("Allow an exposure value to be computed internally. When set to false, either the provided exposure texture or a default exposure value will be used.")]
public bool enableAutoExposure = true; public bool enableAutoExposure = true;
@ -193,7 +190,6 @@ namespace FidelityFX
// Initialize FSR3 Upscaler context // Initialize FSR3 Upscaler context
Fsr3Upscaler.InitializationFlags flags = 0; Fsr3Upscaler.InitializationFlags flags = 0;
if (_renderCamera.allowHDR) flags |= Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange; if (_renderCamera.allowHDR) flags |= Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange;
if (enableFP16) flags |= Fsr3Upscaler.InitializationFlags.EnableFP16Usage;
if (enableAutoExposure) flags |= Fsr3Upscaler.InitializationFlags.EnableAutoExposure; if (enableAutoExposure) flags |= Fsr3Upscaler.InitializationFlags.EnableAutoExposure;
if (UsingDynamicResolution()) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution; if (UsingDynamicResolution()) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution;

3
Packages/com.unity.postprocessing/PostProcessing/Editor/PostProcessLayerEditor.cs

@ -33,7 +33,6 @@ namespace UnityEditor.Rendering.PostProcessing
SerializedProperty m_FsrQualityMode; SerializedProperty m_FsrQualityMode;
SerializedProperty m_FsrPerformSharpen; SerializedProperty m_FsrPerformSharpen;
SerializedProperty m_FsrSharpness; SerializedProperty m_FsrSharpness;
SerializedProperty m_FsrEnableFP16;
SerializedProperty m_FsrExposureSource; SerializedProperty m_FsrExposureSource;
SerializedProperty m_FsrExposureTexture; SerializedProperty m_FsrExposureTexture;
SerializedProperty m_FsrPreExposure; SerializedProperty m_FsrPreExposure;
@ -93,7 +92,6 @@ namespace UnityEditor.Rendering.PostProcessing
m_FsrQualityMode = FindProperty(x => x.superResolution.qualityMode); m_FsrQualityMode = FindProperty(x => x.superResolution.qualityMode);
m_FsrPerformSharpen = FindProperty(x => x.superResolution.performSharpenPass); m_FsrPerformSharpen = FindProperty(x => x.superResolution.performSharpenPass);
m_FsrSharpness = FindProperty(x => x.superResolution.sharpness); m_FsrSharpness = FindProperty(x => x.superResolution.sharpness);
m_FsrEnableFP16 = FindProperty(x => x.superResolution.enableFP16);
m_FsrExposureSource = FindProperty(x => x.superResolution.exposureSource); m_FsrExposureSource = FindProperty(x => x.superResolution.exposureSource);
m_FsrExposureTexture = FindProperty(x => x.superResolution.exposure); m_FsrExposureTexture = FindProperty(x => x.superResolution.exposure);
m_FsrPreExposure = FindProperty(x => x.superResolution.preExposure); m_FsrPreExposure = FindProperty(x => x.superResolution.preExposure);
@ -229,7 +227,6 @@ namespace UnityEditor.Rendering.PostProcessing
EditorGUILayout.PropertyField(m_FsrQualityMode); EditorGUILayout.PropertyField(m_FsrQualityMode);
EditorGUILayout.PropertyField(m_FsrPerformSharpen); EditorGUILayout.PropertyField(m_FsrPerformSharpen);
EditorGUILayout.PropertyField(m_FsrSharpness); EditorGUILayout.PropertyField(m_FsrSharpness);
EditorGUILayout.PropertyField(m_FsrEnableFP16);
EditorGUILayout.PropertyField(m_FsrExposureSource); EditorGUILayout.PropertyField(m_FsrExposureSource);
if (m_FsrExposureSource.intValue == (int)SuperResolution.ExposureSource.Manual) EditorGUILayout.PropertyField(m_FsrExposureTexture); if (m_FsrExposureSource.intValue == (int)SuperResolution.ExposureSource.Manual) EditorGUILayout.PropertyField(m_FsrExposureTexture);
EditorGUILayout.PropertyField(m_FsrPreExposure); EditorGUILayout.PropertyField(m_FsrPreExposure);

4
Packages/com.unity.postprocessing/PostProcessing/Runtime/Effects/SuperResolution.cs

@ -42,9 +42,6 @@ namespace UnityEngine.Rendering.PostProcessing
[Tooltip("Strength of the sharpening effect.")] [Tooltip("Strength of the sharpening effect.")]
[Range(0, 1)] public float sharpness = 0.8f; [Range(0, 1)] public float sharpness = 0.8f;
[Tooltip("Allow the use of half precision compute operations, potentially improving performance if the platform supports it.")]
public bool enableFP16 = false;
[Tooltip("Choose where to get the exposure value from. Use auto-exposure from either FSR3 or Unity, provide a manual exposure texture, or use a default value.")] [Tooltip("Choose where to get the exposure value from. Use auto-exposure from either FSR3 or Unity, provide a manual exposure texture, or use a default value.")]
public ExposureSource exposureSource = ExposureSource.Auto; public ExposureSource exposureSource = ExposureSource.Auto;
[Tooltip("Value by which the input signal will be divided, to get back to the original signal produced by the game.")] [Tooltip("Value by which the input signal will be divided, to get back to the original signal produced by the game.")]
@ -210,7 +207,6 @@ namespace UnityEngine.Rendering.PostProcessing
// Initialize FSR3 Upscaler context // Initialize FSR3 Upscaler context
Fsr3Upscaler.InitializationFlags flags = 0; Fsr3Upscaler.InitializationFlags flags = 0;
if (context.camera.allowHDR) flags |= Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange; if (context.camera.allowHDR) flags |= Fsr3Upscaler.InitializationFlags.EnableHighDynamicRange;
if (enableFP16) flags |= Fsr3Upscaler.InitializationFlags.EnableFP16Usage;
if (exposureSource == ExposureSource.Auto) flags |= Fsr3Upscaler.InitializationFlags.EnableAutoExposure; if (exposureSource == ExposureSource.Auto) flags |= Fsr3Upscaler.InitializationFlags.EnableAutoExposure;
if (RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution; if (RuntimeUtilities.IsDynamicResolutionEnabled(context.camera)) flags |= Fsr3Upscaler.InitializationFlags.EnableDynamicResolution;

3
README.md

@ -174,6 +174,9 @@ Dynamic resolution works really well in combination with FSR3 Upscaler. Any run-
- Using FP16 mode on Xbox with GDK October 2023 or later causes random jittering artifacts. - Using FP16 mode on Xbox with GDK October 2023 or later causes random jittering artifacts.
This seems to be a shader compilation issue introduced by this GDK update. This seems to be a shader compilation issue introduced by this GDK update.
Workaround: disable FP16 on Xbox consoles. Workaround: disable FP16 on Xbox consoles.
- Using FP16 mode in D3D11 on certain older graphics cards can cause GPU driver crashes.
There appears to be an issue with how Unity compiles the shader code from the FP16 code path.
Workaround: disable FP16 mode.
## Details on implementation ## Details on implementation

Loading…
Cancel
Save