9#include "Containers/Array.h"
10#include "Containers/Map.h"
63 FName IniPlatformName;
159 FShaderMapBase::AssociateWithAsset(
NAME_None);
181 template<
typename ShaderType>
184 ensureMsgf(ShaderType::GetStaticType().GetPermutationCount() == 1,
TEXT(
"Failed to provide PermutationId for shader type %s with %u permutations"), ShaderType::GetStaticType().GetName(), ShaderType::GetStaticType().GetPermutationCount());
188 template<
typename ShaderType>
196 TEXT(
"Using a global shader permutation of %s which hasn't been requested for precaching at runtime. Check the implementation of ShouldPrecachePermutation on the global shader and make sure all required or development only permutations are requested for PSO precaching"), ShaderType::GetStaticType().GetName());
202 template<
typename ShaderType>
210 return GetShader(Type, PermutationId).IsValid();
248 if (
const auto It = SectionMap.CreateConstIterator())
279 template<
typename TViewUniformShaderParameters>
408#define DECLARE_GLOBAL_SHADER(ShaderClass) DECLARE_SHADER_TYPE(ShaderClass, Global)
409#define DECLARE_EXPORTED_GLOBAL_SHADER(ShaderClass, RequiredAPI) DECLARE_EXPORTED_SHADER_TYPE(ShaderClass, Global, RequiredAPI)
410#define IMPLEMENT_GLOBAL_SHADER(ShaderClass,SourceFilename,FunctionName,Frequency) IMPLEMENT_SHADER_TYPE(,ShaderClass,TEXT(SourceFilename),TEXT(FunctionName),Frequency)
443template <
typename TShaderType>
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
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
void ForceInitGlobalShaderType()
Definition GlobalShader.h:444
RENDERCORE_API const int32 GlobalShaderMapId
Definition GlobalShader.cpp:377
RENDERCORE_API FGlobalShaderMap * GetGlobalShaderMap(EShaderPlatform Platform)
Definition GlobalShader.cpp:539
RENDERCORE_API void CreateRecursiveShaders()
Definition GlobalShader.cpp:837
RENDERCORE_API FGlobalShaderMap * GGlobalShaderMap[SP_NumPlatforms]
Definition GlobalShader.cpp:20
RENDERCORE_API ERecursiveShader GRequiredRecursiveShaders
Definition GlobalShader.cpp:817
ERecursiveShader
Definition GlobalShader.h:417
#define LAYOUT_FIELD(T, Name,...)
Definition MemoryLayout.h:471
#define DECLARE_EXPORTED_TYPE_LAYOUT(T, RequiredAPI, Interface)
Definition MemoryLayout.h:559
#define DECLARE_TYPE_LAYOUT(T, Interface)
Definition MemoryLayout.h:557
#define GShaderPlatformForFeatureLevel
Definition RHIGlobals.h:915
FName LegacyShaderPlatformToShaderFormat(EShaderPlatform Platform)
Definition RHIStrings.cpp:237
void SetUniformBufferParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderUniformBufferParameter &Parameter, FRHIUniformBuffer *UniformBufferRHI)
Definition ShaderParameterUtils.h:207
EShaderPermutationFlags
Definition ShaderPermutation.h:19
EShaderPermutationPrecacheRequest
Definition Shader.h:807
#define DECLARE_EXPORTED_SHADER_TYPE(ShaderClass, ShaderMetaTypeShortcut, RequiredAPI,...)
Definition Shader.h:1683
Definition Archive.h:1208
Definition GlobalShader.h:123
const FHashedName & GetHashedSourceFilename() const
Definition GlobalShader.h:129
Definition GlobalShader.h:45
const TMap< FString, TArray< FShaderTypeDependency > > & GetShaderFilenameToDependeciesMap() const
Definition GlobalShader.h:54
RENDERCORE_API void AppendKeyString(FString &KeyString, const TArray< FShaderTypeDependency > &Dependencies) const
Definition GlobalShader.cpp:470
EShaderPermutationFlags GetShaderPermutationFlags() const
Definition GlobalShader.h:58
RENDERCORE_API bool WithEditorOnly() const
Definition GlobalShader.cpp:503
Definition GlobalShader.h:141
virtual RENDERCORE_API void GetShaderList(TMap< FHashedName, TShaderRef< FShader > > &OutShaders) const override
Definition GlobalShader.cpp:588
virtual RENDERCORE_API void GetShaderPipelineList(TArray< FShaderPipelineRef > &OutShaderPipelines) const override
Definition GlobalShader.cpp:593
static RENDERCORE_API FGlobalShaderMapSection * CreateFromArchive(FArchive &Ar)
Definition GlobalShader.cpp:546
Definition GlobalShader.h:173
RENDERCORE_API ~FGlobalShaderMap()
Definition GlobalShader.cpp:603
RENDERCORE_API bool IsComplete(const ITargetPlatform *TargetPlatform) const
Definition GlobalShader.cpp:660
RENDERCORE_API FShaderPipeline * FindOrAddShaderPipeline(const FShaderPipelineType *ShaderPipelineType, FShaderPipeline *ShaderPipeline)
Definition GlobalShader.cpp:731
RENDERCORE_API FGlobalShaderMapSection * FindSection(const FHashedName &HashedShaderFilename)
Definition GlobalShader.cpp:768
bool HasShader(FShaderType *Type, int32 PermutationId) const
Definition GlobalShader.h:208
TShaderRef< ShaderType > GetShader(int32 PermutationId) const
Definition GlobalShader.h:189
TShaderRef< ShaderType > GetShader() const
Definition GlobalShader.h:182
RENDERCORE_API void SaveToGlobalArchive(FArchive &Ar)
Definition GlobalShader.cpp:786
RENDERCORE_API void RemoveShaderPipelineType(const FShaderPipelineType *ShaderPipelineType)
Definition GlobalShader.cpp:750
RENDERCORE_API void LoadFromGlobalArchive(FArchive &Ar)
Definition GlobalShader.cpp:798
RENDERCORE_API void Empty()
Definition GlobalShader.cpp:703
const FGlobalShaderMapSection * GetFirstSection()
Definition GlobalShader.h:246
RENDERCORE_API void BeginCreateAllShaders()
Definition GlobalShader.cpp:620
RENDERCORE_API FGlobalShaderMapSection * FindOrAddSection(const FShaderType *ShaderType)
Definition GlobalShader.cpp:774
RENDERCORE_API bool IsEmpty() const
Definition GlobalShader.cpp:648
RENDERCORE_API void ReleaseAllSections()
Definition GlobalShader.cpp:711
RENDERCORE_API FShaderPipelineRef GetShaderPipeline(const FShaderPipelineType *PipelineType) const
Definition GlobalShader.cpp:614
TShaderRef< ShaderType > GetShader(const typename ShaderType::FPermutationDomain &PermutationVector) const
Definition GlobalShader.h:203
RENDERCORE_API void RemoveShaderTypePermutaion(const FShaderType *Type, int32 PermutationId)
Definition GlobalShader.cpp:741
bool HasShaderPipeline(const FShaderPipelineType *ShaderPipelineType) const
Definition GlobalShader.h:213
RENDERCORE_API FShader * FindOrAddShader(const FShaderType *ShaderType, int32 PermutationId, FShader *Shader)
Definition GlobalShader.cpp:720
RENDERCORE_API void AddSection(FGlobalShaderMapSection *InSection)
Definition GlobalShader.cpp:759
Definition GlobalShader.h:87
friend class FGlobalShaderTypeCompiler
Definition GlobalShader.h:88
FShader::CompiledShaderInitializerType CompiledShaderInitializerType
Definition GlobalShader.h:91
EShaderPermutationPrecacheRequest ShouldPrecachePermutation(EShaderPlatform Platform, int32 PermutationId, EShaderPermutationFlags Flags) const
Definition GlobalShader.h:105
bool ShouldCompilePermutation(EShaderPlatform Platform, int32 PermutationId, EShaderPermutationFlags Flags) const
Definition GlobalShader.h:100
static RENDERCORE_API bool ShouldCompilePipeline(const FShaderPipelineType *ShaderPipelineType, EShaderPlatform Platform, EShaderPermutationFlags Flags)
Definition GlobalShader.cpp:508
IMPLEMENT_SHADER_TYPE_CONSTRUCTOR(FGlobalShaderType, EShaderTypeForDynamicCast::Global, TEXT("global shader"))
Definition GlobalShader.h:269
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &Environment)
Definition GlobalShader.h:289
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, FRHIUniformBuffer *ViewUniformBuffer)
Definition GlobalShader.h:280
Definition MemoryImage.h:858
Definition GlobalShader.h:296
FNULLPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition GlobalShader.h:306
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition GlobalShader.h:300
FNULLPS()
Definition GlobalShader.h:305
Definition NameTypes.h:617
Definition ShaderCompilerJobTypes.h:152
Definition ShaderCompilerJobTypes.h:331
RENDERCORE_API void AssignContent(TMemoryImageObject< FShaderMapContent > InContent)
Definition ShaderMap.cpp:184
bool IsValid() const
Definition Shader.h:2278
const FName & GetFName() const
Definition Shader.h:1468
RENDERCORE_API bool ShouldCompilePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:462
RENDERCORE_API EShaderPermutationPrecacheRequest ShouldPrecachePermutation(const FShaderPermutationParameters &Parameters) const
Definition Shader.cpp:467
static EShaderPermutationPrecacheRequest ShouldPrecachePermutation(const FShaderPermutationParameters &Parameters)
Definition Shader.h:863
static bool ShouldCompilePermutation(const FShaderPermutationParameters &)
Definition Shader.h:860
Definition VertexFactory.h:314
Definition UnrealString.h.inl:34
static TShaderRefBase< ShaderType, PointerTableType > Cast(const TShaderRefBase< OtherShaderType, OtherPointerTableType > &Rhs)
Definition Shader.h:1041
Type
Definition RHIFeatureLevel.h:20
Definition GlobalShader.h:73
const FName GlobalShaderName
Definition GlobalShader.h:74
FGlobalShaderPermutationParameters(FName InGlobalShaderName, EShaderPlatform InShaderPlatform, int32 InPermutationId=0, EShaderPermutationFlags InFlags=EShaderPermutationFlags::HasEditorOnlyData)
Definition GlobalShader.h:76
Definition RHIShaderParameters.h:241
Definition ShaderSerialization.h:174
Definition ShaderCore.h:544
Definition ShaderPermutation.h:27
Definition ShaderSerialization.h:26