UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ShaderCompiler.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 ShaderCompiler.h: Platform independent shader compilation definitions.
5=============================================================================*/
6
7#pragma once
8
10#include "HAL/PlatformProcess.h"
11#include "ShaderCore.h"
12#include "ShaderCompilerCore.h"
14#include "Shader.h"
15#include "HAL/RunnableThread.h"
16#include "HAL/Runnable.h"
17#include "Templates/Atomic.h"
18#include "Templates/UniquePtr.h"
20#include "RHIDefinitions.h"
21#include "GBufferInfo.h"
22#include "ShaderMaterial.h"
23#include "Misc/ScopeRWLock.h"
25#include "Containers/HashTable.h"
26#include "Containers/List.h"
27#include "Containers/Deque.h"
28#include "Hash/Blake3.h"
29#include "Hash/CityHash.h"
30#include "SceneTypes.h"
32
33#include "ShaderCompiler.generated.h"
34
36class FCbObjectView;
37class FCbWriter;
46class FJsonObject;
49
51
54
57
60
66
68
70class FShaderJobCache;
71
115
116#if WITH_EDITOR
117class FGlobalShaderTypeCompiler
118{
119public:
124
129
131 static FShader* FinishCompileShader(const FGlobalShaderType* ShaderType, const FShaderCompileJob& CompileJob, const FShaderPipelineType* ShaderPipelineType);
132};
133#endif // WITH_EDITOR
134
146
149
151{
153
155 uint64 WorkerStateHash;
156
158 double WorkerStateChangeTimestamp;
159
160protected:
165
168
170
176 virtual bool PrintWorkerMemoryUsage(bool bAllowToWaitForLock=true) { return false; }
179
180 // Returns a name for this thread instance. Defaults to "ShaderCompilingThread".
181 virtual const TCHAR* GetThreadName() const
182 {
183 return TEXT("ShaderCompilingThread");
184 }
185
191
192public:
196
198
199 void StartThread();
200
201 // FRunnable interface.
202 virtual void Stop() { bForceFinish = true; }
203 virtual uint32 Run();
204 inline void WaitForCompletion() const
205 {
206 if( Thread )
207 {
209 }
210 }
211
213 virtual int32 CompilingLoop() = 0;
214
217
220
228};
229
235{
237private:
238
241 mutable FCriticalSection WorkerInfosLock;
242
244 double LastCheckForWorkersTime = 0.0;
245
247 bool bParallelizeIO = false;
248
251
252 struct FMemoryMonitoringState
253 {
254 double LastTimeOfMemoryLimitPoll = 0.0;
255 double LastTimeOfSuspeningOrResumingWorkers = 0.0;
256 bool bHasFailedToSuspendWorkers = false;
257 bool bHasSuspendedWorkers = false;
258 }
259 MemoryMonitoringState;
260
261public:
265
270
271protected:
272 virtual bool PrintWorkerMemoryUsage(bool bAllowToWaitForLock = true) override;
274
275private:
276
280 int32 PullTasksFromQueue();
281
285 void PushCompletedJobsToManager();
286
288 void WriteNewTasks();
289
291 bool LaunchWorkersIfNeeded();
292
294 int32 ReadAvailableResults();
295
297 void CompileDirectlyThroughDll();
298
300 virtual int32 CompilingLoop() override;
301
302 virtual void OnMachineResourcesChanged() override;
303
304 virtual void ForEachPendingJob(const FShaderCompileJobCallback& PendingJobCallback) const override;
305
306 void PrintWorkerMemoryUsageWithLockTaken();
307
309 int32 GetNumberOfWorkers() const;
310
312 int32 GetNumberOfAvailableWorkersUnsafe() const;
313 int32 GetNumberOfAvailableWorkers() const;
314
316 int32 GetNumberOfSuspendedWorkersUnsafe() const;
317
322 int32 SuspendWorkersAndBacklogJobs(int32 NumWorkers, int32* OutNumBackloggedJobs = nullptr);
323
328 int32 ResumeSuspendedWorkers(int32 NumWorkers);
329
331 void DiscardWorkerOutputFile(int32 WorkerIndex);
332
334 FString GetWorkingDirectoryForWorker(int32 WorkerIndex, bool bRelativePath = false) const;
335
337 void CheckMemoryLimitViolation();
338
340 bool QueryMemoryStatus(FShaderCompilerJobMemoryLimitInfo& OutInfo);
341
343 bool QueryMemoryLimitViolationStatus(FShaderCompilerJobMemoryLimitInfo& OutInfo);
344};
345
347{
348public:
351
352 static class FArchive* CreateFileHelper(const FString& Filename);
353 static void MoveFileHelper(const FString& To, const FString& From);
354 static void DeleteFileHelper(const FString& Filename);
355
357 static ENGINE_API void GenerateBrdfHeaders(const FName& ShaderFormat);
359 static void AppendGBufferDDCKeyString(const EShaderPlatform Platform, FString& KeyString);
362
367
369
370 static ENGINE_API FGBufferParams FetchGBufferParamsRuntime(EShaderPlatform Platform, EGBufferLayout Layout); // this function is called from renderer
372};
373
375{
376 uint32 NumDispatchedJobs;
377
379
381 bool bIsHung;
382
383public:
387
392
394 virtual int32 CompilingLoop() override;
395
396 static bool IsSupported();
397
398 virtual void ForEachPendingJob(const FShaderCompileJobCallback& PendingJobCallback) const override;
399
400protected:
401
404
405private:
406
407 TArray<FString> GetDependencyFilesForJobs(TArray<FShaderCommonCompileJobPtr>& Jobs);
408 void DispatchShaderCompileJobsBatch(TArray<FShaderCommonCompileJobPtr>& JobsToSerialize);
409
410 virtual const TCHAR* GetThreadName() const override;
411};
412
415
417
418USTRUCT()
420{
426 UPROPERTY()
427 double AccumulatedLocalWorkerIdleTime = 0.0;
428
430 UPROPERTY()
431 double TimesLocalWorkersWereIdle = 0;
432
434 UPROPERTY()
435 int64 JobsAssigned = 0;
436
438 UPROPERTY()
439 int64 JobsCompleted = 0;
440
442 UPROPERTY()
443 double AccumulatedPendingTime = 0;
444
446 UPROPERTY()
447 double MaxPendingTime = 0;
448
450 UPROPERTY()
451 double AccumulatedJobExecutionTime = 0;
452
454 UPROPERTY()
455 double MaxJobExecutionTime = 0;
456
458 UPROPERTY()
459 double AccumulatedJobLifeTime = 0;
460
462 UPROPERTY()
463 double MaxJobLifeTime = 0;
464
466 UPROPERTY()
467 double AccumulatedTaskSubmitJobs = 0.0;
468 UPROPERTY()
469 double AccumulatedTaskSubmitJobsStall = 0.0;
470
472 UPROPERTY()
473 int64 LocalJobBatchesSeen = 0;
474
476 UPROPERTY()
477 int64 TotalJobsReportedInLocalJobBatches = 0;
478
480 UPROPERTY()
481 int64 DistributedJobBatchesSeen = 0;
482
484 UPROPERTY()
485 int64 TotalJobsReportedInDistributedJobBatches = 0;
486
488 UPROPERTY()
489 int32 MinShaderCodeSize = 0;
490
492 UPROPERTY()
493 int32 MaxShaderCodeSize = 0;
494
496 UPROPERTY()
497 uint64 AccumulatedShaderCodeSize = 0;
498
500 UPROPERTY()
501 uint64 NumAccumulatedShaderCodes = 0;
502
504 UPROPERTY()
505 uint32 ShaderMapDDCMisses = 0;
506
508 UPROPERTY()
509 uint32 ShaderMapDDCHits = 0;
510
512 UPROPERTY()
513 uint64 TotalCacheSearchAttempts = 0;
514
516 UPROPERTY()
517 uint64 TotalCacheHits = 0;
518
520 UPROPERTY()
521 uint32 TotalCacheDuplicates = 0;
522
524 UPROPERTY()
525 uint32 TotalCacheDDCQueries = 0;
526
528 UPROPERTY()
529 uint32 TotalCacheDDCHits = 0;
530
532 UPROPERTY()
533 uint64 UniqueCacheInputHashes = 0;
534
538 UPROPERTY()
539 uint64 UniqueCacheOutputs = 0;
540
542 UPROPERTY()
543 uint64 CacheMemUsed = 0;
544
546 UPROPERTY()
547 uint64 CacheMemBudget = 0;
548
550 UPROPERTY()
551 uint32 MaxRemoteAgents = 0;
552
554 UPROPERTY()
555 uint32 MaxActiveAgentCores = 0;
556
558 {
559 AccumulatedLocalWorkerIdleTime += Other.AccumulatedLocalWorkerIdleTime;
560 TimesLocalWorkersWereIdle += Other.TimesLocalWorkersWereIdle;
561 JobsAssigned += Other.JobsAssigned;
562 JobsCompleted += Other.JobsCompleted;
563 AccumulatedPendingTime += Other.AccumulatedPendingTime;
564 MaxPendingTime = FMath::Max(Other.MaxPendingTime, MaxPendingTime);
565 AccumulatedJobExecutionTime += Other.AccumulatedJobExecutionTime;
566 MaxJobExecutionTime = FMath::Max(Other.MaxJobExecutionTime, MaxJobExecutionTime);
567 AccumulatedJobLifeTime += Other.AccumulatedJobLifeTime;
568 MaxJobLifeTime = FMath::Max(Other.MaxJobLifeTime, MaxJobLifeTime);
569 AccumulatedTaskSubmitJobs += Other.AccumulatedTaskSubmitJobs;
570 AccumulatedTaskSubmitJobsStall += Other.AccumulatedTaskSubmitJobsStall;
571 LocalJobBatchesSeen += Other.LocalJobBatchesSeen;
572 TotalJobsReportedInLocalJobBatches += Other.TotalJobsReportedInLocalJobBatches;
573 DistributedJobBatchesSeen += Other.DistributedJobBatchesSeen;
574 TotalJobsReportedInDistributedJobBatches += Other.TotalJobsReportedInDistributedJobBatches;
575 if (Other.MinShaderCodeSize > 0)
576 {
577 MinShaderCodeSize = (MinShaderCodeSize > 0 ? FMath::Min(MinShaderCodeSize, Other.MinShaderCodeSize) : Other.MinShaderCodeSize);
578 }
579 MaxShaderCodeSize = FMath::Max(Other.MaxShaderCodeSize, MaxShaderCodeSize);
580 AccumulatedShaderCodeSize += Other.AccumulatedShaderCodeSize;
581 NumAccumulatedShaderCodes += Other.NumAccumulatedShaderCodes;
582 ShaderMapDDCMisses += Other.ShaderMapDDCMisses;
583 ShaderMapDDCHits += Other.ShaderMapDDCHits;
584 TotalCacheSearchAttempts += Other.TotalCacheSearchAttempts;
585 TotalCacheHits += Other.TotalCacheHits;
586 TotalCacheDuplicates += Other.TotalCacheDuplicates;
587 TotalCacheDDCQueries += Other.TotalCacheDDCQueries;
588 TotalCacheDDCHits += Other.TotalCacheDDCHits;
589 UniqueCacheInputHashes += Other.UniqueCacheInputHashes;
590 UniqueCacheOutputs += Other.UniqueCacheOutputs;
591 CacheMemUsed += Other.CacheMemUsed;
592 CacheMemBudget += Other.CacheMemBudget;
593 MaxRemoteAgents += Other.MaxRemoteAgents;
594 MaxActiveAgentCores += Other.MaxActiveAgentCores;
595
596 return *this;
597 }
598};
599
600USTRUCT()
602{
605 int32 NumMaterialsCooked = 0;
606
608 UPROPERTY()
609 int32 MaterialTranslateCalls = 0;
610
612 UPROPERTY()
613 double MaterialTranslateTotalTimeSec = 0.0;
614
616 UPROPERTY()
617 double MaterialTranslateTranslationOnlyTimeSec = 0.0;
618
620 UPROPERTY()
621 double MaterialTranslateSerializationOnlyTimeSec = 0.0;
622
624 UPROPERTY()
625 int32 MaterialCacheHits = 0;
626
628 {
629 NumMaterialsCooked += Other.NumMaterialsCooked;
630 MaterialTranslateCalls += Other.MaterialTranslateCalls;
631 MaterialTranslateTotalTimeSec += Other.MaterialTranslateTotalTimeSec;
632 MaterialTranslateTranslationOnlyTimeSec += Other.MaterialTranslateTranslationOnlyTimeSec;
633 MaterialTranslateSerializationOnlyTimeSec += Other.MaterialTranslateSerializationOnlyTimeSec;
634 MaterialCacheHits += Other.MaterialCacheHits;
635
636 return *this;
637 }
638
639 void WriteStatSummary(const TCHAR* AggregatedSuffix);
640 void GatherAnalytics(TArray<FAnalyticsEventAttribute>& Attributes);
641};
642
645USTRUCT()
647{
649
650 UPROPERTY()
651 float MinCompileTime = 0.0f;
652 UPROPERTY()
653 float MaxCompileTime = 0.0f;
654 UPROPERTY()
655 float TotalCompileTime = 0.0f;
656 UPROPERTY()
657 float TotalPreprocessTime = 0.0f;
658 UPROPERTY()
659 int32 NumCompiled = 0;
660 UPROPERTY()
661 float AverageCompileTime = 0.0f; // stored explicitly as an optimization
662
664 {
665 MinCompileTime = FMath::Min(MinCompileTime, Other.MinCompileTime);
666 MaxCompileTime = FMath::Max(MaxCompileTime, Other.MaxCompileTime);
667 TotalCompileTime += Other.TotalCompileTime;
668 TotalPreprocessTime += Other.TotalPreprocessTime;
669 NumCompiled += Other.NumCompiled;
670 if (NumCompiled)
671 {
672 AverageCompileTime = TotalCompileTime / static_cast<float>(NumCompiled);
673 }
674 return *this;
675 }
676};
677
678USTRUCT()
680{
682
684 : PermutationHash(0)
685 , Compiled(0)
686 , Cooked(0)
687 , CompiledDouble(0)
688 , CookedDouble(0)
689 {}
690
691 UE_DEPRECATED(5.6, "Use constructor accepting a u64 permutationstring hash instead of a string")
692 FShaderCompilerSinglePermutationStat(FString PermutationString, uint32 Compiled, uint32 Cooked)
693 : Compiled(Compiled)
694 , Cooked(Cooked)
695 , CompiledDouble(0)
696 , CookedDouble(0)
697
698 {
699 PermutationHash = GetPermutationHash(PermutationString);
700 }
701
703 : PermutationHash(PermutationHash)
704 , Compiled(Compiled)
705 , Cooked(Cooked)
706 , CompiledDouble(0)
707 , CookedDouble(0)
708
709 {}
710
712 // Explicitly-defaulted ctors & assignment operators are needed temporarily due to deprecation
713 // of PermutationString field. Can be removed once the deprecation window for said field ends.
719
720 static uint64 GetPermutationHash(const FString& PermutationString)
721 {
722 return CityHash64(reinterpret_cast<const char*>(*PermutationString), PermutationString.Len() * sizeof(TCHAR));
723 }
724
725 UPROPERTY()
726 uint64 PermutationHash;
727
728 UE_DEPRECATED(5.6, "PermutationString is no longer stored due to memory overhead; use PermutationHash to uniquely identify permutation stats")
729 UPROPERTY()
730 uint32 PermutationString = 0u;
731
732 UPROPERTY()
733 uint32 Compiled = 0u;
734
735 UPROPERTY()
737
738 UPROPERTY()
739 uint32 CompiledDouble = 0u;
740
741 UPROPERTY()
742 uint32 CookedDouble = 0u;
743};
744
745USTRUCT()
747{
749
750 UPROPERTY()
752
753 UPROPERTY()
754 uint32 Compiled = 0;
755
756 UPROPERTY()
758
759 UPROPERTY()
760 uint32 CompiledDouble = 0;
761
762 UPROPERTY()
763 uint32 CookedDouble = 0;
764
765 UPROPERTY()
766 float CompileTime = 0.f;
767
768 FShaderStats& operator+=(const FShaderStats& Other)
769 {
770 if (Compiled)
771 {
772 CompiledDouble += Other.Compiled;
773 }
774 else
775 {
776 Compiled += Other.Compiled;
777 }
778
779 if (Cooked)
780 {
781 CookedDouble += Other.Cooked;
782 }
783 else
784 {
785 Cooked += Other.Cooked;
786 }
787
788 CompiledDouble += Other.CompiledDouble;
789 CookedDouble += Other.CookedDouble;
790 CompileTime += Other.CompileTime;
791
792 PermutationCompilations.Append(Other.PermutationCompilations);
793
794 return *this;
795 }
796};
797
799{
800public:
802
806
807 ENGINE_API void RegisterCookedShaders(uint32 NumCooked, float CompileTime, EShaderPlatform Platform, const FString MaterialPath, FString PermutationString = FString(""));
808 ENGINE_API void RegisterCompiledShaders(uint32 NumPermutations, EShaderPlatform Platform, const FString MaterialPath, FString PermutationString = FString(""));
810 ENGINE_API void WriteStats(class FOutputDevice* Ar = nullptr);
813
818 inline void SetMultiProcessAggregated() { bMultiProcessAggregated = true; }
819
821 uint32 GetDDCMisses() const;
822 void AddDDCHit(uint32 NumHits);
823 uint32 GetDDCHits() const;
825
826 enum class EExecutionType
827 {
828 Local,
830 };
831
833 {
835 FString BatchLabel;
837 uint32 WorkerId = 0; // Worker process ID or 0 if it came from a distributed job
838 };
839
841 void RegisterLocalWorkerIdleTime(double IdleTime);
842
845
848
851
854
857
860
862
863private:
864 friend class FShaderJobCache;
865 FCriticalSection CompileStatsLock;
867
869 FShaderCompilerMaterialCounters MaterialCounters;
870
872 TArray<TInterval<double>> JobLifeTimeIntervals;
873
875 TMap<FString, FShaderTimings> ShaderTimings;
876
878 TArray<FWorkerDiagnosticsInfo> WorkerDiagnostics;
879
880 bool bMultiProcessAggregated = false;
881};
882
888
894{
897
898#if PLATFORM_WINDOWS
900#endif // PLATFORM_WINDOWS
903
904public:
907
908private:
909 FName GetAssetTypeName() const override;
910 FTextFormat GetAssetNameFormat() const override;
911 TArrayView<FName> GetDependentTypeNames() const override;
912 int32 GetNumRemainingAssets() const override;
913 void ProcessAsyncTasks(bool bLimitExecutionTime = false) override;
914 void ProcessAsyncTasks(const AssetCompilation::FProcessAsyncTaskParams& Params) override;
915
917 // Thread shared properties: These variables can only be read from or written to when a lock on CompileQueueSection is obtained, since they are used by both threads.
918
920 bool bCompilingDuringGame;
921
924
926 int32 NumExternalJobs;
927
928 void ReleaseJob(FShaderCommonCompileJobPtr& Job);
929 void ReleaseJob(FShaderCommonCompileJob* Job);
930
932 FCriticalSection CompileQueueSection;
933
936
938 // Main thread state - These are only accessed on the main thread and used to track progress
939
941 TMap<int32, FShaderMapFinalizeResults> PendingFinalizeShaderMaps;
942
945
947 // Configuration properties - these are set only on initialization and can be read from either thread
948
950 uint32 NumShaderCompilingThreads;
952 uint32 NumShaderCompilingThreadsDuringGame;
954 int32 MaxShaderJobBatchSize;
956 int32 NumSingleThreadedRunsBeforeRetry;
959 std::atomic<int32> NumDumpedShaderSources = 0;
961 uint32 ProcessId;
963 bool bAllowCompilingThroughWorkers;
965 bool bAllowAsynchronousShaderCompiling;
967 bool bUseOnlyDistributedCompilationThread = false;
969 bool bPromptToRetryFailedShaderCompiles;
971 bool bDebugBreakOnPromptToRetryShaderCompile = false;
973 bool bLogJobCompletionTimes;
975 float ProcessGameThreadTargetTime;
977 FString ShaderBaseWorkingDirectory;
979 FString AbsoluteShaderBaseWorkingDirectory;
981 FString AbsoluteShaderDebugInfoDirectory;
983 FString ShaderCompileWorkerName;
985 int32 LastNumRemainingAssets = 0;
987 FString WorkerCrashLogBaseDirectory;
988
993 double WorkersBusyTime;
994
998 uint64 SuppressedShaderPlatforms;
999
1001 bool bIsEngineLoopInitialized;
1002
1004 IDistributedBuildController* BuildDistributionController = nullptr;
1005
1007 bool bNoShaderCompilation;
1008
1010 bool bAllowForIncompleteShaderMaps;
1011
1014
1016 FDelegateHandle OutOfMemoryDelegateHandle;
1017
1018#if WITH_EDITOR
1020#endif // WITH_EDITOR
1021
1023 void CalculateNumberOfCompilingThreads(int32 NumberOfCores, int32 NumberOfCoresIncludingHyperthreads);
1024
1026 FProcHandle LaunchWorker(const FString& WorkingDirectory, uint32 InParentProcessId, uint32 ThreadId, const FString& WorkerInputFile, const FString& WorkerOutputFile, uint32* OutWorkerProcessId = nullptr);
1027
1030
1032 void BlockOnAllShaderMapCompletion(TMap<int32, FShaderMapFinalizeResults>& CompiledShaderMaps);
1033
1036
1038 void ProcessCompiledShaderMaps(TMap<int32, FShaderMapFinalizeResults>& CompiledShaderMaps, float TimeBudget);
1039
1041 void ProcessCompiledNiagaraShaderMaps(TMap<int32, FShaderMapFinalizeResults>& CompiledShaderMaps, float TimeBudget);
1042
1044 void PropagateMaterialChangesToPrimitives(TMap<TRefCountPtr<FMaterial>, TRefCountPtr<FMaterialShaderMap>>& MaterialsToUpdate);
1045
1048
1050 bool AllTargetPlatformSupportsRemoteShaderCompiling();
1051
1053 void UpdateNumRemainingAssets();
1054
1056 IDistributedBuildController* FindRemoteCompilerController() const;
1057
1059 void ReportMemoryUsage();
1060
1063
1065 FShaderCompileThreadRunnableBase* LaunchRemoteShaderCompilingThread(bool bDelayThreadExecution = false);
1066
1068 FShaderCompileThreadRunnableBase* LaunchLocalShaderCompilingThread(bool bDelayThreadExecution = false);
1069
1072
1073public:
1074
1077
1079 ENGINE_API void OnMachineResourcesChanged(int32 NumberOfCores, int32 NumberOfCoresIncludingHyperthreads);
1080
1083
1086
1089
1095 {
1096 // Heuristic based on the number of jobs outstanding
1097 return GetNumOutstandingJobs() > 80 || GetNumPendingJobs() > 80 || NumExternalJobs > 10;
1098 }
1099
1101 {
1102 return bAllowAsynchronousShaderCompiling;
1103 }
1104
1109 bool IsCompiling() const
1110 {
1111 return GetNumOutstandingJobs() > 0 || HasShaderJobs() || GetNumPendingJobs() > 0 || NumExternalJobs > 0;
1112 }
1113
1120 {
1121 return BuildDistributionController != nullptr;
1122 }
1123
1129 {
1130 return bUseOnlyDistributedCompilationThread;
1131 }
1132
1138 {
1139 return !bIsEngineLoopInitialized;
1140 }
1141
1147 bool HasShaderJobs() const
1148 {
1149 return ShaderMapJobs.Num() > 0 || PendingFinalizeShaderMaps.Num() > 0;
1150 }
1151
1157 {
1158 return GetNumOutstandingJobs() + NumExternalJobs;
1159 }
1160
1165 {
1166 return bCompilingDuringGame ? NumShaderCompilingThreadsDuringGame : NumShaderCompilingThreads;
1167 }
1168
1170 {
1171 NumExternalJobs = NumJobs;
1172 }
1173
1175 {
1176 Never = 0,
1177 Always = 1,
1178 OnError = 2,
1180 };
1181
1187
1188
1190 {
1191 NumDumpedShaderSources++;
1192 }
1193
1195 {
1196 return GetShaderDebugInfoPath();
1197 }
1198
1200 {
1201 return (SuppressedShaderPlatforms & (static_cast<uint64>(1) << Platform)) != 0;
1202 }
1203
1205 {
1206 SuppressedShaderPlatforms |= static_cast<uint64>(1) << Platform;
1207 }
1208
1210 {
1211 return bNoShaderCompilation;
1212 }
1213
1215 {
1217 {
1218 bNoShaderCompilation = toggle;
1219 }
1220 }
1221
1223 {
1224 bAllowForIncompleteShaderMaps = toggle;
1225 }
1226
1228
1234
1235
1236 UE_DEPRECATED(5.6, "ProcessFinishedJob must now be passed an EShaderCompileJobStatus")
1238
1241
1246 ENGINE_API void SubmitJobs(TArray<FShaderCommonCompileJobPtr>& NewJobs, const FString MaterialBasePath, FString PermutationString = FString(""));
1247
1251 ENGINE_API void CancelCompilation(const TCHAR* MaterialName, const TArray<int32>& ShaderMapIdsToCancel);
1252
1258
1263 ENGINE_API void FinishAllCompilation() override;
1264
1268 ENGINE_API void Shutdown() override;
1269
1273 ENGINE_API void PrintStats();
1274
1279
1284
1293
1295 ENGINE_API void ProcessAsyncResults(bool bLimitExecutionTime, bool bBlockOnGlobalShaderCompletion);
1296
1299
1304};
1305
1308
1311
1312#if WITH_EDITOR
1313
1316 const FString& DebugGroupName,
1317 const class FVertexFactoryType* VFType,
1318 const class FShaderType* ShaderType,
1320 int32 PermutationId,
1321 const TCHAR* SourceFilename,
1322 const TCHAR* FunctionName,
1323 FShaderTarget Target,
1325 bool bAllowDevelopmentShaderCompile,
1326 const FString& DebugDescription,
1327 const FString& DebugExtension
1328 );
1329
1332 const FString& DebugGroupName,
1333 const class FVertexFactoryType* VFType,
1334 const class FShaderType* ShaderType,
1336 int32 PermutationId,
1337 const TCHAR* SourceFilename,
1338 const TCHAR* FunctionName,
1339 FShaderTarget Target,
1341 bool bAllowDevelopmentShaderCompile = true,
1342 const TCHAR* DebugDescription = nullptr,
1343 const TCHAR* DebugExtension = nullptr
1344);
1345
1346#endif // WITH_EDITOR
1347
1349
1351extern bool RecompileShaders(const TCHAR* Cmd, FOutputDevice& Ar);
1352
1354extern ENGINE_API bool IsGlobalShaderMapComplete(const TCHAR* TypeNameSubstring = nullptr);
1355
1356#if WITH_EDITORONLY_DATA
1360#endif // WITH_EDITORONLY_DATA
1361
1373
1376
1381
1388extern ENGINE_API bool RecompileChangedShadersForPlatform(const FString& PlatformName);
1389
1395
1398
1399#if WITH_EDITOR
1402
1405#endif // WITH_EDITOR
1406
1409
1414extern ENGINE_API FString SaveGlobalShaderFile(EShaderPlatform Platform, FString SavePath, class ITargetPlatform* TargetPlatform = nullptr);
1415
1467
1469{
1470 None,
1471 Changed,
1472 Global,
1473 Material,
1476};
1477
1479
1534
1535#if WITH_EDITOR
1536
1543extern ENGINE_API void RecompileShadersForRemote(FShaderRecompileData& Args, const FString& OutputDirectory);
1544
1547
1548#endif // WITH_EDITOR
1549
1555
1558
1560extern ENGINE_API void DumpShaderDDCKeyToFile(const EShaderPlatform InPlatform, bool bWithEditor, const TCHAR* DebugGroupName, const FString& DDCKey);
1561
1569extern ENGINE_API void ProcessCookOnTheFlyShaders(bool bReloadGlobalShaders, const TArray<uint8>& MeshMaterialMaps, const TArray<FString>& MaterialsToLoad, const TArray<uint8>& GlobalShaderMap);
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
uint64 CityHash64(const char *s, uint32 len)
Definition CityHash.cpp:388
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#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::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define DECLARE_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:23
EGBufferLayout
Definition GBufferInfo.h:107
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
EShaderPlatform
Definition RHIShaderPlatform.h:11
@ SP_NumPlatforms
Definition RHIShaderPlatform.h:55
EShaderDebugInfoFlags
Definition ShaderCompilerCore.h:188
EShaderCompilerWorkerType
Definition ShaderCompilerCore.h:780
EShaderCompileJobStatus
Definition ShaderCompilerJobTypes.h:77
ENGINE_API void CompileGlobalShaderMap(bool bRefreshShaderMap=false)
Definition ShaderCompiler.cpp:5533
ENGINE_API void FinishRecompileGlobalShaders()
Definition ShaderCompiler.cpp:5708
ENGINE_API void GetShaderCompilerCurrentMemoryLimits(FShaderCompilerMemoryLimits &limits)
Definition ShaderCompilerThreadRunnable.cpp:61
ENGINE_API const FGuid & GetMaterialShaderMapDDCGuid()
Definition ShaderCompiler.cpp:248
ENGINE_API bool IsShaderJobCacheDDCEnabled()
Definition ShaderCompilerJobCache.cpp:159
ENGINE_API FString SaveGlobalShaderFile(EShaderPlatform Platform, FString SavePath, class ITargetPlatform *TargetPlatform=nullptr)
Definition ShaderCompiler.cpp:5100
ODSCRecompileCommand
Definition ShaderCompiler.h:1469
bool CreateShadersOnLoad()
Definition ShaderCompiler.cpp:529
bool RecompileShaders(const TCHAR *Cmd, FOutputDevice &Ar)
Definition ShaderCompiler.cpp:4515
ENGINE_API bool RecompileChangedShadersForPlatform(const FString &PlatformName)
Definition ShaderCompiler.cpp:5607
bool AreShaderErrorsFatal()
Definition ShaderCompiler.cpp:188
ENGINE_API FShaderCompilerStats * GShaderCompilerStats
Definition ShaderCompilerStats.cpp:51
ENGINE_API bool IsMaterialMapDDCEnabled()
Definition ShaderCompilerJobCache.cpp:181
ENGINE_API void LoadGlobalShadersForRemoteRecompile(FArchive &Ar, EShaderPlatform ShaderPlatform)
Definition ShaderCompiler.cpp:5714
ENGINE_API FShaderCompilingManager * GShaderCompilingManager
Definition ShaderCompiler.cpp:617
ENGINE_API void ShutdownGlobalShaderMap()
Definition ShaderCompiler.cpp:5538
ENGINE_API void RecompileGlobalShaders()
Definition ShaderCompiler.cpp:4467
ENGINE_API void PrecacheComputePipelineStatesForGlobalShaders(ERHIFeatureLevel::Type FeatureLevel, const ITargetPlatform *TargetPlatform)
Definition ShaderCompiler.cpp:4932
void GetOutdatedShaderTypes(TArray< const FShaderType * > &OutdatedShaderTypes, TArray< const FShaderPipelineType * > &OutdatedShaderPipelineTypes, TArray< const FVertexFactoryType * > &OutdatedFactoryTypes)
Definition ShaderCompiler.cpp:4486
ENGINE_API const FGuid & GetGlobalShaderMapDDCGuid()
Definition ShaderCompiler.cpp:242
ENGINE_API void BeginRecompileGlobalShaders(const TArray< const FShaderType * > &OutdatedShaderTypes, const TArray< const FShaderPipelineType * > &OutdatedShaderPipelineTypes, EShaderPlatform ShaderPlatform, const ITargetPlatform *TargetPlatform=nullptr, const FShaderCompilerFlags &InExtraCompilerFlags={})
Definition ShaderCompiler.cpp:5687
ENGINE_API bool ShouldDumpShaderDDCKeys()
Definition ShaderCompiler.cpp:254
ENGINE_API void SetShaderCompilerTargetMemoryLimitInMiB(int32 NewLimit)
Definition ShaderCompilerThreadRunnable.cpp:69
ENGINE_API void VerifyGlobalShaders(EShaderPlatform Platform, bool bLoadedFromCacheFile, const TArray< const FShaderType * > *OutdatedShaderTypes=nullptr, const TArray< const FShaderPipelineType * > *OutdatedShaderPipelineTypes=nullptr)
Definition ShaderCompiler.cpp:4927
ENGINE_API bool ShouldCompileODSCOnlyShaders()
Definition ShaderCompilerJobCache.cpp:188
ENGINE_API const TCHAR * ODSCCmdEnumToString(ODSCRecompileCommand Cmd)
Definition ShaderCompiler.cpp:5666
ENGINE_API bool IsGlobalShaderMapComplete(const TCHAR *TypeNameSubstring=nullptr)
Definition ShaderCompiler.cpp:5230
ENGINE_API void ProcessCookOnTheFlyShaders(bool bReloadGlobalShaders, const TArray< uint8 > &MeshMaterialMaps, const TArray< FString > &MaterialsToLoad, const TArray< uint8 > &GlobalShaderMap)
Definition ShaderCompiler.cpp:4384
ENGINE_API void DumpShaderDDCKeyToFile(const EShaderPlatform InPlatform, bool bWithEditor, const TCHAR *DebugGroupName, const FString &DDCKey)
Definition ShaderCompiler.cpp:273
bool AllowShaderCompiling()
Definition ShaderCore.cpp:1020
const FString & GetShaderDebugInfoPath()
Definition ShaderCore.cpp:908
EShaderCompileJobPriority
Definition ShaderCore.h:803
EShaderPermutationFlags
Definition ShaderPermutation.h:19
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition AsyncCompilationHelpers.h:14
Definition CompactBinary.h:1025
Definition CompactBinaryWriter.h:68
Definition IDelegateInstance.h:14
Definition GlobalShader.h:87
Definition JsonObject.h:23
Definition MaterialShared.h:1518
Definition NameTypes.h:617
Definition OutputDevice.h:133
Definition RunnableThread.h:20
virtual void WaitForCompletion()=0
Definition Runnable.h:20
Definition ShaderCompilerJobTypes.h:152
virtual ~FShaderCompileDistributedThreadRunnable_Interface()
Definition ShaderCompilerDistributed.cpp:76
virtual EShaderCompilerWorkerType GetWorkerType() const override final
Definition ShaderCompiler.h:388
static bool IsSupported()
Definition ShaderCompilerDistributed.cpp:45
TMap< EShaderPlatform, TArray< FString > > PlatformShaderInputFilesCache
Definition ShaderCompiler.h:403
IDistributedBuildController & CachedController
Definition ShaderCompiler.h:402
virtual int32 CompilingLoop() override
Definition ShaderCompilerDistributed.cpp:358
virtual void ForEachPendingJob(const FShaderCompileJobCallback &PendingJobCallback) const override
Definition ShaderCompilerDistributed.cpp:617
Definition ShaderCompiler.h:73
void SubmitJobs(const TArray< FShaderCommonCompileJobPtr > &InJobs)
Definition ShaderCompilerJobCache.cpp:1076
int32 GetPendingJobs(EShaderCompilerWorkerType InWorkerType, EShaderCompileJobPriority InPriority, int32 MinNumJobs, int32 MaxNumJobs, TArray< FShaderCommonCompileJobPtr > &OutJobs)
Definition ShaderCompilerJobCache.cpp:1111
int32 GetNumPendingJobs() const
Definition ShaderCompilerJobCache.cpp:1106
int32 GetNumOutstandingJobs() const
Definition ShaderCompilerJobCache.cpp:1101
void ProcessFinishedJob(FShaderCommonCompileJob *FinishedJob, EShaderCompileJobStatus Status)
Definition ShaderCompilerJobCache.cpp:1081
void RemoveJob(FShaderCommonCompileJob *InJob)
Definition ShaderCompilerJobCache.cpp:1066
int32 RemoveAllPendingJobsWithId(uint32 InId)
Definition ShaderCompilerJobCache.cpp:1071
FShaderCompileJob * PrepareJob(uint32 InId, const FShaderCompileJobKey &InKey, EShaderCompileJobPriority InPriority)
Definition ShaderCompilerJobCache.cpp:1056
void GetCachingStats(FShaderCompilerStats &OutStats) const
Definition ShaderCompilerJobCache.cpp:1091
void AddToCacheAndProcessPending(FShaderCommonCompileJob *FinishedJob)
Definition ShaderCompilerJobCache.cpp:1086
Definition ShaderCompilerJobTypes.h:331
Definition ShaderCompiler.h:151
virtual void OnMachineResourcesChanged()
Definition ShaderCompiler.h:219
virtual bool PrintWorkerMemoryUsage(bool bAllowToWaitForLock=true)
Definition ShaderCompiler.h:176
void WaitForCompletion() const
Definition ShaderCompiler.h:204
void SetPriorityRange(EShaderCompileJobPriority MinPriority, EShaderCompileJobPriority MaxPriority)
Definition ShaderCompilerThreadRunnable.cpp:208
bool WorkerStateHeartbeat(uint64 InWorkerStateHash)
Definition ShaderCompilerThreadRunnable.cpp:178
virtual ~FShaderCompileThreadRunnableBase()
Definition ShaderCompiler.h:194
void StartThread()
Definition ShaderCompilerThreadRunnable.cpp:200
int32 MaxPriorityIndex
Definition ShaderCompiler.h:167
virtual void Stop()
Definition ShaderCompiler.h:202
class FShaderCompilingManager * Manager
Definition ShaderCompiler.h:162
FRunnableThread * Thread
Definition ShaderCompiler.h:164
TAtomic< bool > bForceFinish
Definition ShaderCompiler.h:169
virtual void ForEachPendingJob(const FShaderCompileJobCallback &PendingJobCallback) const
Definition ShaderCompiler.h:227
virtual EShaderCompilerWorkerType GetWorkerType() const =0
virtual const TCHAR * GetThreadName() const
Definition ShaderCompiler.h:181
int32 MinPriorityIndex
Definition ShaderCompiler.h:166
virtual FShaderCompileMemoryUsage GetExternalWorkerMemoryUsage()
Definition ShaderCompiler.h:178
virtual uint32 Run()
Definition ShaderCompilerThreadRunnable.cpp:317
Definition ShaderCompiler.h:235
virtual bool PrintWorkerMemoryUsage(bool bAllowToWaitForLock=true) override
Definition ShaderCompilerThreadRunnable.cpp:1168
virtual ~FShaderCompileThreadRunnable()
Definition ShaderCompilerThreadRunnable.cpp:224
virtual FShaderCompileMemoryUsage GetExternalWorkerMemoryUsage() override
Definition ShaderCompilerThreadRunnable.cpp:1188
virtual EShaderCompilerWorkerType GetWorkerType() const override final
Definition ShaderCompiler.h:266
Definition ShaderCompiler.h:347
static void ApplyFetchEnvironment(FShaderMaterialPropertyDefines &DefineData, const FShaderCompilerEnvironment &Environment)
static void ApplyFetchEnvironment(FShaderCompilerDefines &DefineData, const FShaderCompilerEnvironment &Environment)
static ENGINE_API EGBufferLayout FetchGBufferLayout(const FShaderCompilerEnvironment &Environment)
static void MoveFileHelper(const FString &To, const FString &From)
Definition ShaderCompilerUtil.cpp:89
static void ApplyDerivedDefines(FShaderCompilerEnvironment &OutEnvironment, FShaderCompilerEnvironment *SharedEnvironment, const EShaderPlatform Platform)
static void AppendGBufferDDCKeyString(const EShaderPlatform Platform, FString &KeyString)
static void AppendGBufferDDCKey(const EShaderPlatform Platform, FShaderKeyGenerator &KeyGen)
static void ApplyFetchEnvironment(FShaderLightmapPropertyDefines &DefineData, const FShaderCompilerEnvironment &Environment)
static ENGINE_API FGBufferParams FetchGBufferParamsRuntime(EShaderPlatform Platform, EGBufferLayout Layout)
Definition ShaderGenerationUtil.cpp:2293
static ENGINE_API void GenerateBrdfHeaders(const FName &ShaderFormat)
static FGBufferParams FetchGBufferParamsPipeline(EShaderPlatform Platform, EGBufferLayout Layout)
static ENGINE_API void WriteGBufferInfoAutogen(EShaderPlatform TargetPlatform, ERHIFeatureLevel::Type FeatureLevel)
static class FArchive * CreateFileHelper(const FString &Filename)
Definition ShaderCompilerUtil.cpp:63
static void ApplyFetchEnvironment(FShaderGlobalDefines &DefineData, const FShaderCompilerEnvironment &Environment, const EShaderPlatform Platform)
static ENGINE_API void GenerateBrdfHeaders(const EShaderPlatform Platform)
static void DeleteFileHelper(const FString &Filename)
Definition ShaderCompilerUtil.cpp:131
static void ExecuteShaderCompileJob(FShaderCommonCompileJob &Job)
Definition ShaderCompilerUtil.cpp:20
Definition ShaderCore.h:402
Definition ShaderCompiler.h:894
const FString & GetAbsoluteShaderDebugInfoDirectory() const
Definition ShaderCompiler.h:1194
friend class FShaderCompileFASTBuildThreadRunnable
Definition ShaderCompiler.h:902
bool ShouldDisplayCompilingNotification() const
Definition ShaderCompiler.h:1094
ENGINE_API ~FShaderCompilingManager()
Definition ShaderCompiler.cpp:1112
ENGINE_API int32 GetNumOutstandingJobs() const
Definition ShaderCompiler.cpp:1346
bool HasShaderJobs() const
Definition ShaderCompiler.h:1147
EDumpShaderDebugInfo
Definition ShaderCompiler.h:1175
ENGINE_API void GetLocalStats(FShaderCompilerStats &OutStats) const
Definition ShaderCompiler.cpp:2369
bool IsCompiling() const
Definition ShaderCompiler.h:1109
void SetAllowForIncompleteShaderMaps(bool toggle)
Definition ShaderCompiler.h:1222
ENGINE_API FShaderCompileJob * PrepareShaderCompileJob(uint32 Id, const FShaderCompileJobKey &Key, EShaderCompileJobPriority Priority)
Definition ShaderCompiler.cpp:1519
ENGINE_API void SubmitJobs(TArray< FShaderCommonCompileJobPtr > &NewJobs, const FString MaterialBasePath, FString PermutationString=FString(""))
Definition ShaderCompiler.cpp:1444
static ENGINE_API FName GetStaticAssetTypeName()
Definition ShaderCompiler.cpp:1286
ENGINE_API void FinishCompilation(const TCHAR *MaterialName, const TArray< int32 > &ShaderMapIdsToFinishCompiling)
Definition ShaderCompiler.cpp:2678
ENGINE_API FString CreateShaderDebugInfoPath(const FShaderCompilerInput &ShaderCompilerInput) const
Definition ShaderCompiler.cpp:1393
int32 GetNumLocalWorkers() const
Definition ShaderCompiler.h:1164
bool AllowAsynchronousShaderCompiling() const
Definition ShaderCompiler.h:1100
ENGINE_API void OnMachineResourcesChanged(int32 NumberOfCores, int32 NumberOfCoresIncludingHyperthreads)
Definition ShaderCompiler.cpp:1254
void SkipShaderCompilation(bool toggle)
Definition ShaderCompiler.h:1214
ENGINE_API int32 GetNumPendingJobs() const
Definition ShaderCompiler.cpp:1341
ENGINE_API FShaderCompilerMemoryLimits GetCurrentMemoryLimits() const
ENGINE_API EDumpShaderDebugInfo GetDumpShaderDebugInfo() const
Definition ShaderCompiler.cpp:1351
void SuppressWarnings(const EShaderPlatform Platform)
Definition ShaderCompiler.h:1204
void ProcessFinishedJob(FShaderCommonCompileJob *FinishedJob)
Definition ShaderCompiler.h:1237
ENGINE_API void FinishAllCompilation() override
Definition ShaderCompiler.cpp:2727
bool IgnoreAllThrottling() const
Definition ShaderCompiler.h:1137
ENGINE_API bool ShouldRecompileToDumpShaderDebugInfo(const FShaderCompileJob &Job) const
Definition ShaderCompiler.cpp:1398
ENGINE_API FShaderCompileMemoryUsage GetExternalMemoryUsage()
Definition ShaderCompiler.cpp:2378
bool AreWarningsSuppressed(const EShaderPlatform Platform) const
Definition ShaderCompiler.h:1199
void SetExternalJobs(int32 NumJobs)
Definition ShaderCompiler.h:1169
ENGINE_API FShaderPipelineCompileJob * PreparePipelineCompileJob(uint32 Id, const FShaderPipelineCompileJobKey &Key, EShaderCompileJobPriority Priority)
Definition ShaderCompiler.cpp:1537
bool IsShaderCompilationSkipped() const
Definition ShaderCompiler.h:1209
ENGINE_API void ProcessAsyncResults(float TimeSlice, bool bBlockOnGlobalShaderCompletion)
Definition ShaderCompiler.cpp:2783
bool IsRemoteCompilingEnabled() const
Definition ShaderCompiler.h:1119
ENGINE_API EShaderDebugInfoFlags GetDumpShaderDebugInfoFlags() const
Definition ShaderCompiler.cpp:1361
bool IsExclusiveDistributedCompilingEnabled() const
Definition ShaderCompiler.h:1128
ENGINE_API void Shutdown() override
Definition ShaderCompiler.cpp:2356
ENGINE_API void DumpDebugInfoForEachPendingJob(const FShaderCompileJobCallback &PendingJobCallback) const
Definition ShaderCompiler.cpp:2765
ENGINE_API void SetTargetMemoryLimitInMiB(int32 NewLimit)
ENGINE_API void CancelCompilation(const TCHAR *MaterialName, const TArray< int32 > &ShaderMapIdsToCancel)
Definition ShaderCompiler.cpp:2629
ENGINE_API FShaderCompilingManager()
Definition ShaderCompiler.cpp:727
int32 GetNumRemainingJobs() const
Definition ShaderCompiler.h:1156
static bool IsShaderCompilerWorkerRunning(FProcHandle &WorkerHandle)
Definition ShaderCompiler.cpp:2909
ENGINE_API void OnDistributedShaderCompilingChanged()
Definition ShaderCompiler.cpp:1269
ENGINE_API void PrintStats()
Definition ShaderCompiler.cpp:2362
void IncrementNumDumpedShaderSources()
Definition ShaderCompiler.h:1189
ENGINE_API bool IsCompilingShaderMap(uint32 Id)
Definition ShaderCompiler.cpp:1499
Definition ShaderCompilerJobCache.cpp:581
Definition ShaderKeyGenerator.h:29
Definition ShaderCompilerJobTypes.h:419
Definition Shader.h:1931
Definition Shader.h:1238
Definition Shader.h:829
Definition Text.h:278
Definition VertexFactory.h:314
Definition IConsoleManager.h:387
Definition ArrayView.h:139
Definition Array.h:670
Definition Atomic.h:538
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SparseArray.h:524
Definition UniquePtr.h:107
Definition MaterialInterface.h:296
Type
Definition SceneTypes.h:132
@ High
Definition SceneTypes.h:134
Type
Definition RHIFeatureLevel.h:20
@ SM5
Definition RHIFeatureLevel.h:42
Definition IAssetCompilingManager.h:15
Definition AnalyticsEventAttribute.h:48
Definition GBufferInfo.h:294
Definition Guid.h:109
Definition ShaderCompiler.h:1417
TArray< FString > ShaderTypeNames
Definition ShaderCompiler.h:1437
FString RequestHash
Definition ShaderCompiler.h:1443
FString PipelineName
Definition ShaderCompiler.h:1434
int32 PermutationId
Definition ShaderCompiler.h:1440
ERHIFeatureLevel::Type FeatureLevel
Definition ShaderCompiler.h:1422
FODSCRequestPayload()
Definition ShaderCompiler.h:1445
FString MaterialName
Definition ShaderCompiler.h:1428
EMaterialQualityLevel::Type QualityLevel
Definition ShaderCompiler.h:1425
EShaderPlatform ShaderPlatform
Definition ShaderCompiler.h:1419
ENGINE_API friend FArchive & operator<<(FArchive &Ar, FODSCRequestPayload &Elem)
Definition ODSCThread.cpp:46
FString VertexFactoryName
Definition ShaderCompiler.h:1431
Definition AndroidPlatformProcess.h:13
Definition ShaderCompilerJobTypes.h:308
Definition ShaderCompiler.h:136
uint64 PhysicalMemory
Definition ShaderCompiler.h:144
uint64 VirtualMemory
Definition ShaderCompiler.h:140
Definition ShaderCompilerCore.h:637
Definition ShaderCompiler.h:420
double AccumulatedLocalWorkerIdleTime
Definition ShaderCompiler.h:427
Definition ShaderMaterial.h:307
Definition ShaderCore.h:544
Definition ShaderCompilerCore.h:210
Definition ShaderCompilerThreadRunnable.cpp:76
Definition ShaderCompiler.h:602
int32 NumMaterialsCooked
Definition ShaderCompiler.h:605
Definition ShaderCompiler.h:884
uint64 CurrentLimit
Definition ShaderCompiler.h:885
uint64 BaseLimit
Definition ShaderCompiler.h:886
Definition ShaderCompilerCore.h:491
Definition ShaderCompiler.h:680
static PRAGMA_ENABLE_DEPRECATION_WARNINGS uint64 GetPermutationHash(const FString &PermutationString)
Definition ShaderCompiler.h:720
FShaderCompilerSinglePermutationStat & operator=(FShaderCompilerSinglePermutationStat &&)=default
FShaderCompilerSinglePermutationStat & operator=(const FShaderCompilerSinglePermutationStat &)=default
FShaderCompilerSinglePermutationStat(uint64 PermutationHash, uint32 Compiled, uint32 Cooked)
Definition ShaderCompiler.h:702
PRAGMA_DISABLE_DEPRECATION_WARNINGS FShaderCompilerSinglePermutationStat(FShaderCompilerSinglePermutationStat &&)=default
FShaderCompilerSinglePermutationStat(const FShaderCompilerSinglePermutationStat &)=default
Definition ShaderCompiler.h:833
FString BatchLabel
Definition ShaderCompiler.h:835
int32 BatchSize
Definition ShaderCompiler.h:836
uint32 WorkerId
Definition ShaderCompiler.h:837
FShaderCompileWorkerDiagnostics WorkerDiagnosticsOutput
Definition ShaderCompiler.h:834
Definition ShaderCompiler.h:799
ENGINE_API void RegisterCookedShaders(uint32 NumCooked, float CompileTime, EShaderPlatform Platform, const FString MaterialPath, FString PermutationString=FString(""))
Definition ShaderCompilerStats.cpp:1087
void AddDDCHit(uint32 NumHits)
Definition ShaderCompilerStats.cpp:1178
uint32 GetDDCHits() const
Definition ShaderCompilerStats.cpp:1183
void RegisterAssignedJob(FShaderCommonCompileJob &InOutJob)
Definition ShaderCompilerStats.cpp:904
void IncrementMaterialTranslated(double InTotalTime, double InTranslationOnlyTime, double InSerializeTime)
Definition ShaderCompilerStats.cpp:1072
EExecutionType
Definition ShaderCompiler.h:827
void RegisterWorkerDiagnostics(const FShaderCompileWorkerDiagnostics &InDiagnostics, FString &&InBatchLabel, int32 InBatchSize, uint32 InWorkerId)
Definition ShaderCompilerStats.cpp:1029
const TSparseArray< ShaderCompilerStats > & GetShaderCompilerStats()
Definition ShaderCompiler.h:809
void RegisterJobBatch(int32 NumJobs, EExecutionType ExecType)
Definition ShaderCompilerStats.cpp:1002
ENGINE_API void GatherAnalytics(const FString &BaseName, TArray< FAnalyticsEventAttribute > &Attributes)
Definition ShaderCompilerStats.cpp:471
void RegisterLocalWorkerIdleTime(double IdleTime)
Definition ShaderCompilerStats.cpp:886
void RegisterNewPendingJob(FShaderCommonCompileJob &InOutJob)
Definition ShaderCompilerStats.cpp:894
void IncrementMaterialCacheHit()
Definition ShaderCompilerStats.cpp:1081
ENGINE_API uint32 GetTotalShadersCompiled()
Definition ShaderCompilerStats.cpp:552
void SetMultiProcessAggregated()
Definition ShaderCompiler.h:818
void AddDDCMiss(uint32 NumMisses)
Definition ShaderCompilerStats.cpp:1168
ENGINE_API void ReadFromCompactBinary(FCbObjectView &Reader)
Definition ShaderCompilerStats.cpp:788
uint32 GetDDCMisses() const
Definition ShaderCompilerStats.cpp:1173
ENGINE_API void WriteStatSummary()
Definition ShaderCompilerStats.cpp:258
ENGINE_API void WriteToCompactBinary(FCbWriter &Writer)
Definition ShaderCompilerStats.cpp:703
ENGINE_API TSharedPtr< FJsonObject > ToJson()
Definition ShaderCompilerStats.cpp:659
double GetTimeShaderCompilationWasActive()
Definition ShaderCompilerStats.cpp:1188
void IncrementMaterialCook()
Definition ShaderCompilerStats.cpp:1066
void RegisterDistributedBuildStats(const FDistributedBuildStats &InStats)
Definition ShaderCompilerStats.cpp:1022
void RegisterFinishedJob(FShaderCommonCompileJob &InOutJob)
Definition ShaderCompilerStats.cpp:917
ENGINE_API void RegisterCompiledShaders(uint32 NumPermutations, EShaderPlatform Platform, const FString MaterialPath, FString PermutationString=FString(""))
Definition ShaderCompilerStats.cpp:1127
ENGINE_API void WriteStats(class FOutputDevice *Ar=nullptr)
Definition ShaderCompilerStats.cpp:53
Definition ShaderMaterial.h:17
Definition ShaderCompilerJobCache.cpp:378
Definition ShaderMaterial.h:72
Definition ShaderCompilerJobTypes.h:23
Definition ShaderMaterial.h:95
Definition ShaderCompilerJobTypes.h:397
Definition ShaderCompiler.h:1481
ENGINE_API FShaderRecompileData(const FString &InPlatformName, TArray< FString > *OutModifiedFiles, TArray< uint8 > *OutMeshMaterialMaps, TArray< uint8 > *OutGlobalShaderMap)
TArray< FString > MaterialsToLoad
Definition ShaderCompiler.h:1502
ENGINE_API FShaderRecompileData(const FString &InPlatformName, EShaderPlatform InShaderPlatform, ODSCRecompileCommand InCommandType, TArray< FString > *OutModifiedFiles, TArray< uint8 > *OutMeshMaterialMaps, TArray< uint8 > *OutGlobalShaderMap)
TArray< FODSCRequestPayload > ShadersToRecompile
Definition ShaderCompiler.h:1514
TArray< uint8 > * MeshMaterialMaps
Definition ShaderCompiler.h:1499
TArray< FString > * ModifiedFiles
Definition ShaderCompiler.h:1496
FShaderRecompileData()
Definition ShaderCompiler.h:1524
FString ShaderTypesToLoad
Definition ShaderCompiler.h:1505
ENGINE_API friend FArchive & operator<<(FArchive &Ar, FShaderRecompileData &Elem)
ERHIFeatureLevel::Type FeatureLevel
Definition ShaderCompiler.h:1488
ODSCRecompileCommand CommandType
Definition ShaderCompiler.h:1508
EMaterialQualityLevel::Type QualityLevel
Definition ShaderCompiler.h:1490
FString PlatformName
Definition ShaderCompiler.h:1483
TArray< uint8 > * GlobalShaderMap
Definition ShaderCompiler.h:1511
EShaderPlatform ShaderPlatform
Definition ShaderCompiler.h:1486
FShaderCompilerFlags ExtraCompilerFlags
Definition ShaderCompiler.h:1493
TArray< TStrongObjectPtr< UMaterialInterface > > * LoadedMaterialsToRecompile
Definition ShaderCompiler.h:1517
Definition ShaderCompiler.h:747
uint32 Compiled
Definition ShaderCompiler.h:754
Definition ShaderCore.h:186
Definition ShaderCompiler.h:647
Definition IAssetCompilingManager.h:25
Definition PimplPtr.h:50