UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ShaderCompilerCore.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 ShaderCompilerCore.h: Shader Compiler core module definitions.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10#include "HAL/FileManager.h"
11#include "Hash/Blake3.h"
12#include "Hash/xxhash.h"
13#include "Stats/Stats.h"
15#include "Misc/EnumClassFlags.h"
16#include "Misc/SecureHash.h"
17#include "Misc/Paths.h"
18#include "Misc/PathViews.h"
19#include "Misc/CoreStats.h"
20#include "ShaderCore.h"
22
23class Error;
24class IShaderFormat;
29
32
33// this is for the protocol, not the data, bump if FShaderCompilerInput/FShaderPreprocessOutput serialization, SerializeWorkerInput or ProcessInputFromArchive changes.
35// this is for the protocol, not the data, bump if FShaderCompilerOutput or WriteToOutputArchive changes.
37// this is for the protocol, not the data.
39// this is for the protocol, not the data.
41
42// Modify this in ShaderCompilerCore.cpp to invalidate _just_ the cache/DDC entries for individual shaders (will not cause
43// shadermaps to rebuild if they are not otherwise out-of-date).
44// This should be bumped for changes to the FShaderCompilerOutput data structure (in addition to ShaderCompileWorkerOutputVersion)
46
48{
51
52 UE_DEPRECATED(5.7, "GetBindlessResourcesConfiguration is now GetBindlessConfiguration")
54
55 UE_DEPRECATED(5.7, "GetBindlessSamplersConfiguration is now GetBindlessConfiguration")
57}
58
61
63extern RENDERCORE_API const FString& GetShaderDebugInfoPath();
64
66extern RENDERCORE_API bool ShouldGenerateShaderSymbols(FName ShaderFormat);
67
70
72extern RENDERCORE_API bool ShouldWriteShaderSymbols(FName ShaderFormat);
73
75extern RENDERCORE_API bool GetShaderSymbolPathOverride(FString& OutPathOverride, FName ShaderFormat);
76
80extern RENDERCORE_API bool GetShaderFileNameOverride(FString& OutFileNameOverride, const TCHAR* Cvar, FName ShaderFormat, FName PlatformName);
81
84
86{
87 Disable = 0,
88 UnCompress = 1,
89 Compress = 2
90};
91
94
96extern RENDERCORE_API bool ShouldEnableExtraShaderData(FName ShaderFormat);
97
98extern RENDERCORE_API bool ShouldOptimizeShaders(FName ShaderFormat);
99
102
105
106
108{
109 #define SHADER_COMPILER_FLAGS_ENTRY(Name) CFLAG_##Name,
110 #define SHADER_COMPILER_FLAGS_ENTRY_DEPRECATED(Name, Version, Message) CFLAG_##Name UE_DEPRECATED(Version, Message),
111 #include "ShaderCompilerFlags.inl"
114static_assert(CFLAG_PreferFlowControl == 0, "First entry in ECompilerFlags must be 'CFLAG_PreferFlowControl' and assigned to 0");
115static_assert(CFLAG_Max < 64, "Out of bitfield space! Modify FShaderCompilerFlags");
116
119
152
155{
156 Mali,
157 Adreno,
158
159 Num
160};
161
164{
168 FString GPUTarget;
169 bool bDumpAll = false;
171 bool bMobileMultiView = false;
172
174 {
175 // Note: this serialize is used to pass between UE and the shader compile worker, recompile both when modifying
176 return Ar << StatsSettings.bExtractShaderSource << StatsSettings.OfflineCompilerPath
177 << StatsSettings.OfflineCompiler << StatsSettings.GPUTarget << StatsSettings.bDumpAll << StatsSettings.bSaveCompilerStatsFiles << StatsSettings.bMobileMultiView;
178 }
179};
180
181namespace FOodleDataCompression
182{
183 enum class ECompressor : uint8;
184 enum class ECompressionLevel : int8;
185}
186
188{
189 Default = 0,
190 DirectCompileCommandLine UE_DEPRECATED(5.7, "DirectCompile has been renamed DebugCompile and DebugCompileArgs.txt is dumped by default") = 1 << 0,
191 InputHash = 1 << 1,
192 Diagnostics = 1 << 2,
193 ShaderCodeBinary = 1 << 3,
194 DetailedSource = 1 << 4,
195 CompileFromDebugUSF = 1 << 5,
197};
199
201
207
210{
212
216
217 // Preferred output format for FShaderCode, e.g. when DXIL is preferred over DXBC while both would be supported.
219
222 FString ShaderName;
223
225
226 // Indicates which additional debug outputs should be written for this compile job.
228
229 // Array of symbols that should be maintained when deadstripping. If this is empty, entry
230 // point name alone will be used.
232
233 // Shader pipeline information
235
236 // Dump debug path (up to platform) e.g. "D:/Project/Saved/ShaderDebugInfo/PCD3D_SM5"
238 // only used if enabled by r.DumpShaderDebugInfo (platform/groupname) e.g. ""
240 // materialname or "Global" "for debugging and better error messages
242
244
245 // Description of the configuration used when compiling.
247
248 // Hash of this input (used as the key for the shader job cache)
250
251 // Compilation Environment
254
255 // The root of the shader parameter structures / uniform buffers bound to this shader to generate shader resource table from.
256 // This only set if a shader class is defining the
258
259
260 // Additional compilation settings that can be filled by FMaterial::SetupExtraCompilationSettings
261 // FMaterial::SetupExtraCompilationSettings is usually called by each (*)MaterialShaderType::BeginCompileShader() function
263
266
269
272
273 // Internal only flag to signal that bindless is enabled
274 bool bBindlessEnabled = false;
275
280
285
286 // generate human readable name for debugging
287 FString GenerateShaderName() const
288 {
289 FString Name;
290
291 if(DebugGroupName == TEXT("Global"))
292 {
294 }
295 else
296 {
298 }
299
300 return Name;
301 }
302
307
308 FString GetSourceFilename() const
309 {
311 }
312
313 // Common code to generate a debug string to associate with platform-specific shader symbol files and hashes
314 // Currently uses DebugGroupName, but can be updated to contain other important information as needed
315 FString GenerateDebugInfo() const
316 {
318 }
319
336
352
375
377
379 {
381 }
382
383 bool IsWorkGraphShader() const
384 {
386 }
387
389 {
390 // stable constant buffer is for the FShaderParameterBindings::BindForLegacyShaderParameters() code path.
391 // Ray tracing shaders use FShaderParameterBindings::BindForRootShaderParameters instead.
392 if (IsRayTracingShader())
393 {
394 return false;
395 }
396
397 return RootParametersStructure != nullptr;
398 }
399
400 bool IsBindlessEnabled() const
401 {
402 return bBindlessEnabled;
403 }
404
407};
408
411{
419
427
435
443
449
452
455
457 FString RENDERCORE_API GetErrorString(bool bOmitLineMarker = false) const;
458
465 inline bool HasLineMarker() const
466 {
467 return !HighlightedLine.IsEmpty() && !HighlightedLineMarker.IsEmpty();
468 }
469
472
476
479
481 {
482 return Ar << Error.ErrorVirtualFilePath << Error.ErrorLineString << Error.StrippedErrorMessage << Error.HighlightedLine << Error.HighlightedLineMarker;
483 }
484};
485
491{
502
515 UE_DEPRECATED(5.6, "bSerializeModifiedSource is no longer used")
519
521 // Explicitly-defaulted copy/move ctors & assignment operators are needed temporarily due to deprecation
522 // of bSerializeModifiedSource field. These can be removed once the deprecation window for this field ends.
526 FShaderCompilerOutput& operator=(const FShaderCompilerOutput&) = default;
528
533
535
542
547
548 UE_DEPRECATED(5.6, "Use symbols accessors (GetSymbolWriteAccess, GetSymbolReadView) on FShaderCode object instead (ShaderCode member)")
550
552
555
557 RENDERCORE_API void CompressOutput(FName ShaderCompressionFormat, FOodleDataCompression::ECompressor OodleCompressor, FOodleDataCompression::ECompressionLevel OodleLevel);
558
561
564
565 template<typename TValue>
566 void AddStatistic(const TCHAR* Name, TValue Value, FGenericShaderStat::EFlags Flags = FGenericShaderStat::EFlags::None, FName TagName = NAME_None)
567 {
568 // handle the case where a stat with the given name already exists; some backends compile iteratively and this is a simpler way to handle that
569 // than requiring each backend to manually avoid setting until the "final" compilation. linear search is in practice fine here; there are low
570 // single digit numbers of stats for all existing shader formats at the time of writing.
571 FName StatName(Name);
572 FGenericShaderStat* Stat = nullptr;
574 {
575 if (ExistingStat.StatName == StatName)
576 {
578 break;
579 }
580 }
581
582 if (!Stat)
583 {
585 Stat->StatName = StatName;
586 }
587
589 Stat->Flags = Flags;
590 Stat->TagName = TagName;
591 }
592
597
599 {
600 return ShaderCode.SetFromResource(MoveTemp(Resource));
601 }
602
603 // Bump ShaderCompileWorkerOutputVersion if FShaderCompilerOutput changes
605 {
606 // Note: this serialize is used to pass between UE and the shader compile worker, recompile both when modifying
607 Ar << Output.ParameterMap;
608 Ar << Output.Errors;
609 Ar << Output.Target;
610 Ar << Output.bSerializingForCache;
611 if (!Output.bSerializingForCache)
612 {
613 // skip serializing these fields when saving to cache/DDC; only needed when reading back results from workers
614 Ar << Output.ShaderCode;
615 Ar << Output.ValidateInputHash;
616 Ar << Output.CompileTime;
617 }
618 Ar << Output.OutputHash;
619 Ar << Output.NumInstructions;
620 Ar << Output.NumTextureSamplers;
621 Ar << Output.bSucceeded;
622 Ar << Output.ModifiedShaderSource;
623 Ar << Output.ModifiedEntryPointName;
624 Ar << Output.ShaderStatistics;
625
626 // note: intentionally never serializing the following fields:
627 // - PreprocessTime - it is always set in the cooker since we no longer run preprocessing in SCW
628 // - bSupportsQueryingUsedAttributes - only used when compiling pipelines by subsequent stage compile steps, these are always executed in order in a single SCW job invocation
629 // - UsedAttributes - as above
630
631 return Ar;
632 }
633};
634
637{
640
643
646
648 double BatchProcessTime = 0.0;
649
652
654 {
655 Ar << Output.ErrorCode << Output.EntryPointTimestamp << Output.BatchPreparationTime << Output.BatchProcessTime << Output.BatchIndex;
656 return Ar;
657 }
658};
659
660#if PLATFORM_WINDOWS
662#endif
664
665// Executes preprocessing for the given job, if the job is marked to be preprocessed independently prior to compilation.
667extern RENDERCORE_API void CompileShader(const TArray<const IShaderFormat*>& ShaderFormats, FShaderCompileJob& Job, const FString& WorkingDirectory, int32* CompileCount = nullptr);
669
676
680extern RENDERCORE_API void FixupShaderFilePath(FString& VirtualFilePath, EShaderPlatform ShaderPlatform, const FName* ShaderPlatformName);
681
683{
684 None = 0,
685 NoSimdPadding = 1 << 0,
686};
692
700
702
703
705{
706 FXxHash64 PathInSourceHash; // PathInSourceHash doesn't include PathInSource's null terminator, so hash computation can use a string view
707 TArray<ANSICHAR> PathInSource; // Path as it appears in include directive in original shader source, allowing faster case sensitive hash
708 TArray<ANSICHAR> ParentPath; // For relative paths, ResultPath is dependent on the parent file the include directive is found in
710 uint32 ResultPathHash; // Case insensitive hash of ResultPath (compatible with hash of corresponding FString)
711 uint32 ResultPathUniqueIndex; // Index of first instance of a given result path in Dependencies array
712 FShaderSharedAnsiStringPtr StrippedSource; // Source with comments stripped out, and converted to ANSICHAR (output of ShaderConvertAndStripComments)
713
715 {
716 // PathInSource is case sensitive, ParentPath is case insensitive.
717 // If the path is absolute (starts with '/'), then the parent path isn't relevant, and shouldn't be checked.
718 return
722 }
723
728
733};
734
735
736// Structure that provides an array of #include dependencies for a given root shader file, including not just immediate
737// dependencies, but recursive dependencies from children as well. Not exhaustive, as it does not include platform
738// specific or generated files, although it does include children of "/Engine/Generated/Material.ush", as derived from
739// "/Engine/Private/MaterialTemplate.ush". Take the example of ClearUAV.usf:
740//
741// /Engine/Private/Tools/ClearUAV.usf #include "../Common.ush"
742// /Engine/Private/Common.ush #include "/Engine/Public/Platform.ush"
743// #include "PackUnpack.ush"
744// /Engine/Public/Platform.ush #include "FP16Math.ush"
745//
746// The above is a small subset, but the above (and many more) would all show up as elements in Dependencies:
747//
748// PathInSource ParentPath ResultPath
749// --------------------------------------------------------------------------------------------------------
750// ../Common.ush /Engine/Private/Tools/ClearUAV.usf /Engine/Private/Common.ush
751// /Engine/Public/Platform.ush /Engine/Private/Common.ush /Engine/Public/Platform.ush
752// PackUnpack.ush /Engine/Private/Common.ush /Engine/Private/PackUnpack.ush
753// FP16Math.ush /Engine/Public/Platform.ush /Engine/Public/FP16Math.ush
754//
755// The goal of this structure is to allow a shader preprocessor implementation to fetch most of the source dependencies in a
756// single query of the loaded shader cache, and then efficiently search for dependencies encountered in the shader source
757// code, without needing to do string operations to resolve paths (such as converting relative paths like "../Common.ush" to
758// "/Engine/Private/Common.ush"). Besides that, the array organization can be used to manage encountered source files
759// by index, rather than needing a map, and the "ResultPath" strings from this structure can be referenced by pointer,
760// rather than needing to dynamically allocate a copy of the resolved path. Lookups by PathInSource can use a much faster
761// case sensitive hash, because PathInSource has verbatim capitalization from the source code files. Altogether, this
762// utility structure saves a bunch of shader cache query, hash, map, string, and memory allocation overhead.
763//
765{
766 // First item in array contains stripped source for root file, and is not in the hash tables
768 FHashTable BySource; // Hash table by PathInSource
769 FHashTable ByResult; // Hash table by ResultPath
770};
771
773
778
780{
781 None,
784};
785
787{
788 Single,
789 Pipeline,
790 Num,
791};
793
794
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::ANSICHAR ANSICHAR
An ANSI character. Normally a signed type.
Definition Platform.h:1131
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
const bool
Definition NetworkReplayStreaming.h:178
@ SF_NumFrequencies
Definition RHIDefinitions.h:216
bool IsRayTracingShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1679
ERHIBindlessConfiguration
Definition RHIDefinitions.h:1432
bool IsWorkGraphShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1702
EShaderPlatform
Definition RHIShaderPlatform.h:11
@ SP_NumPlatforms
Definition RHIShaderPlatform.h:55
RENDERCORE_API bool ShouldGenerateShaderSymbols(FName ShaderFormat)
Definition ShaderCore.cpp:870
RENDERCORE_API void ShaderConvertAndStripComments(const FString &ShaderSource, TArray< ANSICHAR > &OutStripped, EConvertAndStripFlags Flags=EConvertAndStripFlags::None)
Definition ShaderCore.cpp:2485
EWriteShaderSymbols
Definition ShaderCompilerCore.h:86
RENDERCORE_API const FString & GetShaderDebugInfoPath()
Definition ShaderCore.cpp:908
EShaderDebugInfoFlags
Definition ShaderCompilerCore.h:188
const int32 ShaderCompileWorkerOutputVersion
Definition ShaderCompilerCore.h:36
RENDERCORE_API void FixupShaderFilePath(FString &VirtualFilePath, EShaderPlatform ShaderPlatform, const FName *ShaderPlatformName)
Definition ShaderCore.cpp:2458
RENDERCORE_API void CompileShader(const TArray< const IShaderFormat * > &ShaderFormats, FShaderCompileJob &Job, const FString &WorkingDirectory, int32 *CompileCount=nullptr)
Definition ShaderCore.cpp:2091
RENDERCORE_API bool LoadShaderSourceFile(const TCHAR *VirtualFilePath, EShaderPlatform ShaderPlatform, FString *OutFileContents, TArray< FShaderCompilerError > *OutCompileErrors, const FName *ShaderPlatformName=nullptr, FShaderSharedAnsiStringPtr *OutStrippedContents=nullptr)
Definition ShaderCore.cpp:2803
const int32 ShaderCompileWorkerInputVersion
Definition ShaderCompilerCore.h:34
RENDERCORE_API const TCHAR * LexToString(ECompilerFlags InValue)
Definition ShaderCore.cpp:4872
RENDERCORE_API bool ShouldEnableExtraShaderData(FName ShaderFormat)
Definition ShaderCore.cpp:998
EConvertAndStripFlags
Definition ShaderCompilerCore.h:683
constexpr int32 NumShaderCompileJobTypes
Definition ShaderCompilerCore.h:792
EShaderCompileJobType
Definition ShaderCompilerCore.h:787
RENDERCORE_API bool AllowShaderCompiling()
Definition ShaderCore.cpp:1020
RENDERCORE_API const IShaderFormat * FindShaderFormat(FName Format, const TArray< const IShaderFormat * > &ShaderFormats)
Definition ShaderCore.cpp:1692
RENDERCORE_API bool GetShaderPreprocessDependencies(const TCHAR *VirtualFilePath, EShaderPlatform ShaderPlatform, FShaderPreprocessDependenciesShared &OutDependencies)
Definition ShaderCore.cpp:3154
const int32 ShaderCompileWorkerSingleJobHeader
Definition ShaderCompilerCore.h:38
RENDERCORE_API bool ShouldGenerateShaderSymbolsInfo(FName ShaderFormat)
Definition ShaderCore.cpp:877
RENDERCORE_API bool ShouldOptimizeShaders(FName ShaderFormat)
Definition ShaderCore.cpp:1004
RENDERCORE_API bool GetShaderFileNameOverride(FString &OutFileNameOverride, const TCHAR *Cvar, FName ShaderFormat, FName PlatformName)
Definition ShaderCore.cpp:960
RENDERCORE_API bool PreprocessShader(FShaderCommonCompileJob *Job)
Definition ShaderCore.cpp:2047
TSharedPtr< FShaderPreprocessDependencies, ESPMode::ThreadSafe > FShaderPreprocessDependenciesShared
Definition ShaderCompilerCore.h:772
RENDERCORE_API bool ShouldAllowUniqueShaderSymbols(FName ShaderFormat)
Definition ShaderCore.cpp:890
RENDERCORE_API bool LoadCachedShaderSourceFile(const TCHAR *VirtualFilePath, EShaderPlatform ShaderPlatform, FShaderSharedStringPtr *OutFileContents, TArray< FShaderCompilerError > *OutCompileErrors, const FName *ShaderPlatformName=nullptr, FShaderSharedAnsiStringPtr *OutStrippedContents=nullptr)
Definition ShaderCore.cpp:2733
TSharedPtr< TArray< ANSICHAR >, ESPMode::ThreadSafe > FShaderSharedAnsiStringPtr
Definition ShaderCompilerCore.h:31
RENDERCORE_API bool GetShaderSymbolPathOverride(FString &OutPathOverride, FName ShaderFormat)
Definition ShaderCore.cpp:939
ECompilerFlags
Definition ShaderCompilerCore.h:108
@ CFLAG_Max
Definition ShaderCompilerCore.h:112
RENDERCORE_API const FString & GetBuildMachineArtifactBasePath()
Definition ShaderCore.cpp:896
RENDERCORE_API void CompileShaderPipeline(const TArray< const IShaderFormat * > &ShaderFormats, FShaderPipelineCompileJob *PipelineJob, const FString &WorkingDirectory, int32 *CompileCount=nullptr)
Definition ShaderCore.cpp:2121
const int32 ShaderCompileWorkerPipelineJobHeader
Definition ShaderCompilerCore.h:40
RENDERCORE_API EWriteShaderSymbols GetWriteShaderSymbolsOptions(FName ShaderFormat)
Definition ShaderCore.cpp:992
RENDERCORE_API bool ShouldWriteShaderSymbols(FName ShaderFormat)
Definition ShaderCore.cpp:883
RENDERCORE_API const FGuid UE_SHADER_CACHE_VERSION
Definition ShaderCompilerCore.cpp:5
RENDERCORE_API bool AllowGlobalShaderLoad()
Definition ShaderCore.cpp:1038
RENDERCORE_API void LexFromString(ECompilerFlags &OutValue, const TCHAR *InString)
Definition ShaderCore.cpp:4860
EOfflineShaderCompilerType
Definition ShaderCompilerCore.h:155
RENDERCORE_API bool CheckVirtualShaderFilePath(FStringView VirtualPath, TArray< FShaderCompilerError > *CompileErrors=nullptr)
Definition ShaderCore.cpp:1639
EShaderCompilerWorkerType
Definition ShaderCompilerCore.h:780
TVariant< bool, float, int32, uint32, FString > FShaderStatVariant
Definition ShaderCore.h:58
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT bool IsSaving() const
Definition Archive.h:248
Definition HashTable.h:210
Definition NameTypes.h:617
Definition UnrealType.h:3087
static CORE_API FStringView GetCleanFilename(const FStringView &InPath)
Definition PathViews.cpp:100
static CORE_API FString GetCleanFilename(const FString &InPath)
Definition Paths.cpp:967
Definition SecureHash.h:226
Definition ShaderCore.h:1134
Definition ShaderCore.h:1242
const FShaderCodeResource & GetFinalizedResource(EShaderFrequency Frequency, FSHAHash OutputHash) const
Definition ShaderCore.h:1410
void SetFromResource(FShaderCodeResource &&Resource)
Definition ShaderCore.h:1479
Definition ShaderCompilerJobTypes.h:152
Definition ShaderCompilerJobTypes.h:331
bool Contains(uint32 InFlag) const
Definition ShaderCore.h:426
Definition ShaderCore.h:323
Definition ShaderParameterMetadata.h:136
Definition ShaderCompilerJobTypes.h:419
static CORE_API IFileManager & Get()
Definition FileManagerGeneric.cpp:1072
virtual bool DirectoryExists(const TCHAR *InDirectory)=0
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
ElementType & AddZeroed_GetRef() UE_LIFETIMEBOUND
Definition Array.h:2779
Definition RefCounting.h:454
Definition UniquePtr.h:107
@ IgnoreCase
Definition CString.h:26
Definition OodleDataCompression.cpp:28
ECompressor
Definition OodleDataCompression.h:49
ECompressionLevel
Definition OodleDataCompression.h:94
Definition ShaderCompilerCore.h:48
RENDERCORE_API bool ShouldCompileWithBindlessEnabled(EShaderPlatform ShaderPlatform, const FShaderCompilerInput &Input)
Definition ShaderCore.cpp:828
RENDERCORE_API ERHIBindlessConfiguration GetBindlessConfiguration(EShaderPlatform ShaderPlatform)
Definition ShaderCore.cpp:805
RENDERCORE_API ERHIBindlessConfiguration GetBindlessSamplersConfiguration(FName ShaderFormat)
Definition ShaderCore.cpp:818
RENDERCORE_API ERHIBindlessConfiguration GetBindlessResourcesConfiguration(FName ShaderFormat)
Definition ShaderCore.cpp:812
_EXCEPTION_POINTERS * LPEXCEPTION_POINTERS
Definition MinimalWindowsApi.h:89
@ false
Definition radaudio_common.h:23
Definition Blake3.h:27
Definition ShaderCompilerCore.h:164
FString OfflineCompilerPath
Definition ShaderCompilerCore.h:166
bool bDumpAll
Definition ShaderCompilerCore.h:169
friend FArchive & operator<<(FArchive &Ar, FExtraShaderCompilerSettings &StatsSettings)
Definition ShaderCompilerCore.h:173
bool bMobileMultiView
Definition ShaderCompilerCore.h:171
bool bSaveCompilerStatsFiles
Definition ShaderCompilerCore.h:170
FString GPUTarget
Definition ShaderCompilerCore.h:168
EOfflineShaderCompilerType OfflineCompiler
Definition ShaderCompilerCore.h:167
bool bExtractShaderSource
Definition ShaderCompilerCore.h:165
Definition ShaderCore.h:70
FName StatName
Definition ShaderCore.h:77
Definition Guid.h:109
Definition RHIDefinitions.h:1746
Definition RHIDefinitions.h:1752
Definition RHIDefinitions.h:1758
Definition ShaderCompilerCore.h:637
int32 BatchIndex
Definition ShaderCompilerCore.h:651
double EntryPointTimestamp
Definition ShaderCompilerCore.h:642
double BatchProcessTime
Definition ShaderCompilerCore.h:648
double BatchPreparationTime
Definition ShaderCompilerCore.h:645
int32 ErrorCode
Definition ShaderCompilerCore.h:639
friend FArchive & operator<<(FArchive &Ar, FShaderCompileWorkerDiagnostics &Output)
Definition ShaderCompilerCore.h:653
Definition ShaderCore.h:544
RENDERCORE_API void Merge(const FShaderCompilerEnvironment &Other)
Definition ShaderCore.cpp:1225
FShaderCompilerFlags CompilerFlags
Definition ShaderCore.h:551
TMap< FString, FThreadSafeSharedAnsiStringPtr > IncludeVirtualPathToSharedContentsMap
Definition ShaderCore.h:549
Definition ShaderCompilerCore.h:411
FString RENDERCORE_API GetErrorString(bool bOmitLineMarker=false) const
Definition ShaderCore.cpp:3929
FShaderCompilerError(FString &&InStrippedErrorMessage, FString &&InHighlightedLine, FString &&InHighlightedLineMarker)
Definition ShaderCompilerCore.h:436
friend FArchive & operator<<(FArchive &Ar, FShaderCompilerError &Error)
Definition ShaderCompilerCore.h:480
FString StrippedErrorMessage
Definition ShaderCompilerCore.h:446
FString RENDERCORE_API GetErrorStringWithLineMarker() const
Definition ShaderCore.cpp:3915
bool HasLineMarker() const
Definition ShaderCompilerCore.h:465
FString RENDERCORE_API GetErrorStringWithSourceLocation() const
Definition ShaderCore.cpp:3903
static void RENDERCORE_API ExtractSourceLocations(TArray< FShaderCompilerError > &InOutErrors)
Definition ShaderCore.cpp:4003
bool RENDERCORE_API ExtractSourceLocation()
Definition ShaderCore.cpp:3971
FShaderCompilerError(const TCHAR *InVirtualFilePath, const TCHAR *InLineString, const TCHAR *InStrippedErrorMessage)
Definition ShaderCompilerCore.h:420
FString RENDERCORE_API GetShaderSourceFilePath(TArray< FShaderCompilerError > *InOutErrors=nullptr) const
Definition ShaderCore.cpp:4046
FString ErrorVirtualFilePath
Definition ShaderCompilerCore.h:444
FShaderCompilerError(FString &&InStrippedErrorMessage)
Definition ShaderCompilerCore.h:428
FString ErrorLineString
Definition ShaderCompilerCore.h:445
FShaderCompilerError(const TCHAR *InStrippedErrorMessage=TEXT(""))
Definition ShaderCompilerCore.h:412
FString HighlightedLine
Definition ShaderCompilerCore.h:447
FString HighlightedLineMarker
Definition ShaderCompilerCore.h:448
Definition ShaderCompilerCore.h:210
void DeserializeSharedInputs(FArchive &Ar, const TArray< FShaderCompilerEnvironment > &SharedEnvironments, const TArray< TUniquePtr< FShaderParametersMetadata > > &ShaderParameterStructures)
Definition ShaderCompilerCore.h:353
const FShaderParametersMetadata * RootParametersStructure
Definition ShaderCompilerCore.h:257
FString GetSourceFilename() const
Definition ShaderCompilerCore.h:308
FString DumpDebugInfoPath
Definition ShaderCompilerCore.h:239
FName ShaderPlatformName
Definition ShaderCompilerCore.h:215
uint32 SupportedHardwareMask
Definition ShaderCompilerCore.h:224
FString GenerateShaderName() const
Definition ShaderCompilerCore.h:287
bool bCompilingForShaderPipeline
Definition ShaderCompilerCore.h:270
bool bIncludeUsedOutputs
Definition ShaderCompilerCore.h:271
void SerializeSharedInputs(FArchive &Ar, const TArray< TRefCountPtr< FSharedShaderCompilerEnvironment > > &SharedEnvironments, const TArray< const FShaderParametersMetadata * > &ParametersStructures)
Definition ShaderCompilerCore.h:337
FName ShaderFormat
Definition ShaderCompilerCore.h:213
FShaderCompilerInputHash Hash
Definition ShaderCompilerCore.h:249
FName PreferredShaderCodeFormat
Definition ShaderCompilerCore.h:218
FString DebugGroupName
Definition ShaderCompilerCore.h:241
bool DumpDebugInfoEnabled() const
Definition ShaderCompilerCore.h:276
TArray< FString > UsedOutputs
Definition ShaderCompilerCore.h:234
bool bBindlessEnabled
Definition ShaderCompilerCore.h:274
TArray< FString > RequiredSymbols
Definition ShaderCompilerCore.h:231
bool ShouldUseStableConstantBuffer() const
Definition ShaderCompilerCore.h:388
FString ShaderName
Definition ShaderCompilerCore.h:222
friend RENDERCORE_API FArchive & operator<<(FArchive &Ar, FShaderCompilerInput &Input)
Definition ShaderCore.cpp:4243
bool IsRayTracingShader() const
Definition ShaderCompilerCore.h:378
bool NeedsOriginalShaderSource() const
Definition ShaderCompilerCore.h:281
FExtraShaderCompilerSettings ExtraSettings
Definition ShaderCompilerCore.h:262
TRefCountPtr< FSharedShaderCompilerEnvironment > SharedEnvironment
Definition ShaderCompilerCore.h:253
FShaderTarget Target
Definition ShaderCompilerCore.h:211
FString GenerateDebugInfo() const
Definition ShaderCompilerCore.h:315
FString VirtualSourceFilePath
Definition ShaderCompilerCore.h:220
FShaderCompilerEnvironment Environment
Definition ShaderCompilerCore.h:252
FOodleDataCompression::ECompressionLevel OodleLevel
Definition ShaderCompilerCore.h:268
FName CompressionFormat
Definition ShaderCompilerCore.h:214
bool IsWorkGraphShader() const
Definition ShaderCompilerCore.h:383
FString DumpDebugInfoRootPath
Definition ShaderCompilerCore.h:237
FString DebugExtension
Definition ShaderCompilerCore.h:243
EShaderDebugInfoFlags DebugInfoFlags
Definition ShaderCompilerCore.h:227
FString DebugDescription
Definition ShaderCompilerCore.h:246
FOodleDataCompression::ECompressor OodleCompressor
Definition ShaderCompilerCore.h:265
FString EntryPointName
Definition ShaderCompilerCore.h:221
bool IsBindlessEnabled() const
Definition ShaderCompilerCore.h:400
RENDERCORE_API FString GetOrCreateShaderDebugInfoPath() const
Definition ShaderCore.cpp:3874
FStringView GetSourceFilenameView() const
Definition ShaderCompilerCore.h:303
void GatherSharedInputs(TArray< TRefCountPtr< FSharedShaderCompilerEnvironment > > &SharedEnvironments, TArray< const FShaderParametersMetadata * > &ParametersStructures)
Definition ShaderCompilerCore.h:320
Definition ShaderCompilerCore.h:491
FShaderCode ShaderCode
Definition ShaderCompilerCore.h:506
FShaderCompilerInputHash ValidateInputHash
Definition ShaderCompilerCore.h:508
TArray< FShaderCodeValidationType > ParametersUAVTypeToValidate
Definition ShaderCompilerCore.h:531
FSHAHash OutputHash
Definition ShaderCompilerCore.h:507
FShaderCompilerOutput()
Definition ShaderCompilerCore.h:492
TArray< FShaderCodeValidationUBSize > ParametersUBSizeToValidate
Definition ShaderCompilerCore.h:532
TArray< FGenericShaderStat > ShaderStatistics
Definition ShaderCompilerCore.h:551
TArray< FShaderCompilerError > Errors
Definition ShaderCompilerCore.h:504
FString ModifiedEntryPointName
Definition ShaderCompilerCore.h:546
const FShaderCodeResource & GetFinalizedCodeResource() const
Definition ShaderCompilerCore.h:593
TArray< FString > UsedAttributes
Definition ShaderCompilerCore.h:518
uint32 NumTextureSamplers
Definition ShaderCompilerCore.h:510
TArray< FShaderDiagnosticData > ShaderDiagnosticDatas
Definition ShaderCompilerCore.h:534
uint32 NumInstructions
Definition ShaderCompilerCore.h:509
double PreprocessTime
Definition ShaderCompilerCore.h:512
FString ModifiedShaderSource
Definition ShaderCompilerCore.h:541
RENDERCORE_API void GenerateOutputHash()
Definition ShaderCore.cpp:1554
TArray< FShaderCodeValidationType > ParametersSRVTypeToValidate
Definition ShaderCompilerCore.h:530
FShaderTarget Target
Definition ShaderCompilerCore.h:505
bool bSerializingForCache
Definition ShaderCompilerCore.h:517
bool bSucceeded
Definition ShaderCompilerCore.h:513
bool bSerializeModifiedSource
Definition ShaderCompilerCore.h:516
RENDERCORE_API void SerializeShaderDiagnosticData()
Definition ShaderCore.cpp:1607
RENDERCORE_API void CompressOutput(FName ShaderCompressionFormat, FOodleDataCompression::ECompressor OodleCompressor, FOodleDataCompression::ECompressionLevel OodleLevel)
Definition ShaderCore.cpp:1572
RENDERCORE_API void SerializeShaderCodeValidation()
Definition ShaderCore.cpp:1580
double CompileTime
Definition ShaderCompilerCore.h:511
void SetCodeFromResource(FShaderCodeResource &&Resource)
Definition ShaderCompilerCore.h:598
void AddStatistic(const TCHAR *Name, TValue Value, FGenericShaderStat::EFlags Flags=FGenericShaderStat::EFlags::None, FName TagName=NAME_None)
Definition ShaderCompilerCore.h:566
PRAGMA_ENABLE_DEPRECATION_WARNINGS TArray< FShaderCodeValidationStride > ParametersStrideToValidate
Definition ShaderCompilerCore.h:529
FShaderParameterMap ParameterMap
Definition ShaderCompilerCore.h:503
bool bSupportsQueryingUsedAttributes
Definition ShaderCompilerCore.h:514
friend FArchive & operator<<(FArchive &Ar, FShaderCompilerOutput &Output)
Definition ShaderCompilerCore.h:604
Definition ShaderCompilerCore.h:121
TArray< uint32 > ResourceTableLayoutHashes
Definition ShaderCompilerCore.h:144
uint32 ResourceTableBits
Definition ShaderCompilerCore.h:123
TArray< uint32 > SamplerMap
Definition ShaderCompilerCore.h:135
TArray< uint32 > ShaderResourceViewMap
Definition ShaderCompilerCore.h:132
FShaderCompilerResourceTable()
Definition ShaderCompilerCore.h:146
TArray< uint32 > TextureMap
Definition ShaderCompilerCore.h:129
uint32 MaxBoundResourceTable
Definition ShaderCompilerCore.h:126
TArray< uint32 > ResourceCollectionMap
Definition ShaderCompilerCore.h:141
TArray< uint32 > UnorderedAccessViewMap
Definition ShaderCompilerCore.h:138
Definition ShaderCompilerCore.h:203
TArray< TPair< EShaderFrequency, FString > > DebugSourceFiles
Definition ShaderCompilerCore.h:205
Definition ShaderCore.h:947
Definition ShaderCompilerCore.h:765
TArray< FShaderPreprocessDependency > Dependencies
Definition ShaderCompilerCore.h:767
FHashTable ByResult
Definition ShaderCompilerCore.h:769
FHashTable BySource
Definition ShaderCompilerCore.h:768
Definition ShaderCompilerCore.h:705
TArray< ANSICHAR > ResultPath
Definition ShaderCompilerCore.h:709
bool EqualsResultPath(const FString &InResultPath, uint32 InResultPathHash) const
Definition ShaderCompilerCore.h:724
uint32 ResultPathUniqueIndex
Definition ShaderCompilerCore.h:711
FXxHash64 PathInSourceHash
Definition ShaderCompilerCore.h:706
bool EqualsResultPath(const ANSICHAR *InResultPath, uint32 InResultPathHash) const
Definition ShaderCompilerCore.h:729
uint32 ResultPathHash
Definition ShaderCompilerCore.h:710
TArray< ANSICHAR > ParentPath
Definition ShaderCompilerCore.h:708
bool EqualsPathInSource(const ANSICHAR *InPathInSource, int32 InPathInSourceLen, FXxHash64 InPathInSourceHash, const ANSICHAR *InParentPath) const
Definition ShaderCompilerCore.h:714
FShaderSharedAnsiStringPtr StrippedSource
Definition ShaderCompilerCore.h:712
TArray< ANSICHAR > PathInSource
Definition ShaderCompilerCore.h:707
Definition ShaderCore.h:186
EShaderFrequency GetFrequency() const
Definition ShaderCore.h:233
Definition xxhash.h:19
static UE_FORCEINLINE_HINT int32 Stricmp(const CharType *String1, const CharType *String2)
Definition CString.h:1030
static UE_FORCEINLINE_HINT int32 Strncmp(const CharType *String1, const CharType *String2, SIZE_T Count)
Definition CString.h:1024
Definition TVariant.h:13