Browse Source

Force enable FP16 shader code path, and redefine FFXM_HALF with a truthy value

armasr
Nico de Poel 10 months ago
parent
commit
cfae0072e9
  1. 1
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrContext.cs
  2. 4
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/ffxm_fsr2_common.cginc

1
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Runtime/AsrContext.cs

@ -52,6 +52,7 @@ namespace ArmASR
public void Create(in Asr.ContextDescription contextDescription) public void Create(in Asr.ContextDescription contextDescription)
{ {
_contextDescription = contextDescription; _contextDescription = contextDescription;
_contextDescription.Flags |= Asr.InitializationFlags.EnableFP16Usage; // Always force FP16 code path
_upscalerConstantsBuffer = CreateConstantBuffer<Asr.UpscalerConstants>(); _upscalerConstantsBuffer = CreateConstantBuffer<Asr.UpscalerConstants>();
_spdConstantsBuffer = CreateConstantBuffer<Asr.SpdConstants>(); _spdConstantsBuffer = CreateConstantBuffer<Asr.SpdConstants>();

4
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/ASR/Shaders/ffxm_fsr2_common.cginc

@ -4,6 +4,10 @@
#pragma warning(disable: 3556) // Integer divides might be much slower, try using uints if possible #pragma warning(disable: 3556) // Integer divides might be much slower, try using uints if possible
// If these keywords are set by Unity, redefine them to have a truthy value // If these keywords are set by Unity, redefine them to have a truthy value
#if defined(FFXM_HALF)
#undef FFXM_HALF
#define FFXM_HALF (1)
#endif
#ifdef FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE #ifdef FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE
#undef FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE #undef FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE
#define FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE 1 #define FFXM_FSR2_OPTION_SHADER_OPT_PERFORMANCE 1

Loading…
Cancel
Save