UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ShaderCompilerFlags.inl
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 ShaderCompilerFlags.inl: Flags used in ECompilerFlags enumeration.
5=============================================================================*/
6
7#if !defined(SHADER_COMPILER_FLAGS_ENTRY)
8#error SHADER_COMPILER_FLAGS_ENTRY must be defined before including ShaderCompilerFlags.inl
9#endif
10
11#if !defined(SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED)
12#define SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED(Name, Version, Message)
13#endif
14
15// To add a flag:
16// SHADER_COMPILER_FLAGS_ENTRY(FlagName) - generates CFLAG_FlagName
17// For deprecated flags:
18// SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED(FlagName, X.X, "Deprecation Message") - generates CFLAG_FlagName UE_DEPRECATED(X.X, "Deprecation Message")
19
23// Disable shader validation
25// Only allows standard optimizations, not the longest compile times.
27// Always optimize even whenDebug is set. Required for some complex shaders and features.
29// Shader should generate symbols for debugging.
31// Shader should insert debug/name info at the risk of generating non-deterministic libraries
33// Allows the (external) symbols to be specific to each shader rather than trying to deduplicate.
36// Explicitly enforce zero initialization on shader platforms that may omit it.
38// Explicitly enforce bounds checking on shader platforms that may omit it.
40// Force removing unused interpolators for platforms that can opt out
42// Hint that it is a vertex to geometry shader
44// Hint that it is a vertex to primitive shader
46// Hint that a vertex shader should use automatic culling on certain platforms.
48// Prepare the shader for archiving in the native binary shader cache format
50// Shaders uses external texture so may need special runtime handling
52// Use emulated uniform buffers on supported platforms
54// Enable wave operation intrinsics (requires DX12 and DXC/DXIL on PC).
55// Check GRHISupportsWaveOperations before using shaders compiled with this flag at runtime.
56// https://github.com/Microsoft/DirectXShaderCompiler/wiki/Wave-Intrinsics
58// Use DirectX Shader Compiler (DXC) to compile all shaders - intended for compatibility testing.
61// Temporarily disable optimizations with DXC compiler only - intended to workaround shader compiler bugs until they can be resolved with 1st party
63// Typed UAV loads are disallowed by default as Windows 7 D3D 11.0 does not support them; this flag allows a shader to use them.
65// Prefer shader execution in wave32 mode if possible.
67// Enable support of inline raytracing in compute shader.
69// Enable support of C-style data types for platforms that can. Check for PLATFORM_SUPPORTS_REAL_TYPES and FDataDrivenShaderPlatformInfo::GetSupportsRealTypes()
71// Precompile HLSL to optimized HLSL then forward to FXC. Speeds up some shaders that take longer with FXC and works around crashes in FXC.
73// Enable HLSL 2021 version. Enables templates, operator overloading, and C++ style function overloading. Contains breaking change with short-circuiting evaluation.
75// Allow warnings to be treated as errors
77SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED(BindlessResources, 5.7, "This flag is now internal to the shader compiler.")
79// Force disable bindless resources and samplers on a shader
81// EXPERIMENTAL: Run the shader re-writer that removes any unused functions/resources/types from source code before compilation.
83// Enable CullBeforeFetch optimization on supported platforms
85// Enable WarpCulling optimization on supported platforms
87// Shader should generate minimal symbols info
89// Enabled root constants optimization on supported platforms
91// Specifies that a shader provides derivatives, and the compiler should look in the compiled ISA for any instructions requiring
92// auto derivatives. If none are found, the shader will be marked with EShaderResourceUsageFlags::NoDerivativeOps, meaning that
93// calling code can safely assume only provided derivatives are used.
95// Shader is used with indirect draws. This flag is currently used to fix a platform specific problem with certain (rare) indirect draw setups, but it is intended to be set for all indirect draw shaders in the future.
96// Must not be used on shaders that are used with direct draws. Doing so might cause crashes or visual corruption on certain platforms.
98// Shader is used with shader bundles.
100// Shader code should not be stripped of comments/whitespace/line directives at the end of preprocessing
102// Shader uses RHI Shader Binding Layout for global shader binding
104// Request full shader analysis artifacts in output statistics. This may contain multiple compilation steps in full text form.
106// Force to generate debug info, i.e. FShaderConductorOptions::bEnableDebugInfo.
108
109// Include in the "Minimal" bindless configuration.
111
112#undef SHADER_COMPILER_FLAGS_ENTRY
113#undef SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED(Name, Version, Message)
Definition ShaderCompilerFlags.inl:12
#define SHADER_COMPILER_FLAGS_ENTRY(Name)