Browse Source

Commented out all experimental DXC-related pragmas, as these could sometimes cause shader compilation issues even when not enabled.

hdrp
Nico de Poel 3 years ago
parent
commit
856f735228
  1. 12
      Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute
  2. 14
      Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc

12
Assets/Resources/FSR2/ffx_fsr2_compute_luminance_pyramid_pass.compute

@ -31,11 +31,13 @@
#include "ffx_fsr2_unity_common.cginc" #include "ffx_fsr2_unity_common.cginc"
// Wave operations require shader model 6.0; this can only be enabled when using DXC on D3D12 // 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 #define SPD_NO_WAVE_OPERATIONS
#endif
//#endif
#include "shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl" #include "shaders/ffx_fsr2_compute_luminance_pyramid_pass.hlsl"

14
Assets/Resources/FSR2/ffx_fsr2_unity_common.cginc

@ -26,14 +26,16 @@
#define FFX_HLSL // Compile for plain HLSL #define FFX_HLSL // Compile for plain HLSL
// Use the DXC shader compiler on modern graphics APIs to enable a few advanced features // 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 // 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 // Hack to work around the lack of texture atomics on Metal
#if defined(SHADER_API_METAL) #if defined(SHADER_API_METAL)

Loading…
Cancel
Save