diff --git a/Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute b/Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute index 69d3d9a..bce3c6f 100644 --- a/Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute +++ b/Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute @@ -31,11 +31,13 @@ #include "ffx_fsr2_unity_common.cginc" // Wave operations require shader model 6.0; this can only be enabled when using DXC on D3D12 -#if defined(UNITY_COMPILER_DXC) && defined(SHADER_API_D3D12) -#pragma require WaveBasic // Required for WaveGetLaneIndex -#pragma require WaveBallot // Required for WaveReadLaneAt -#else +// These pragmas are commented out by default as Unity will sometimes ignore the #if's and try to enable these features anyway. +// Uncomment the below lines if you intend to try wave operations on DX12 with the DXC compiler. +//#if defined(UNITY_COMPILER_DXC) && defined(SHADER_API_D3D12) +//#pragma require WaveBasic // Required for WaveGetLaneIndex +//#pragma require WaveBallot // Required for WaveReadLaneAt +//#else #define SPD_NO_WAVE_OPERATIONS -#endif +//#endif #include "shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl" diff --git a/Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc b/Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc index 2df9e01..4d2985b 100644 --- a/Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc +++ b/Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc @@ -26,14 +26,16 @@ #define FFX_HLSL // Compile for plain HLSL // Use the DXC shader compiler on modern graphics APIs to enable a few advanced features -#if defined(SHADER_API_D3D12) || defined(SHADER_API_VULKAN) || defined(SHADER_API_METAL) -//#pragma use_dxc // Using DXC will currently break DX11 support since DX11 and DX12 share the same shader bytecode in Unity. Disabling this by default... *sigh* -#endif +// The DXC-related pragmas are disabled by default, as DXC doesn't support all platforms yet and will break on some platforms when enabled. +// Consider this to be an experimental feature. If you want to benefit from 16-bit floating point and wave operations, and don't care about supporting older graphics APIs, then it's worth a try. +//#if defined(SHADER_API_D3D12) || defined(SHADER_API_VULKAN) || defined(SHADER_API_METAL) +//#pragma use_dxc // Using DXC will currently break DX11 support since DX11 and DX12 share the same shader bytecode in Unity. +//#endif // Enable half precision data types on platforms that support it -#if defined(UNITY_COMPILER_DXC) && defined(FFX_HALF) -#pragma require Native16Bit -#endif +//#if defined(UNITY_COMPILER_DXC) && defined(FFX_HALF) +//#pragma require Native16Bit +//#endif // Hack to work around the lack of texture atomics on Metal #if defined(SHADER_API_METAL)