![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "Containers/Array.h"#include "Containers/Map.h"#include "Containers/UnrealString.h"#include "CoreMinimal.h"#include "HAL/Platform.h"#include "Misc/AssertionMacros.h"#include "Misc/Paths.h"#include "RHI.h"#include "RHIDefinitions.h"#include "RHIResources.h"#include "Serialization/MemoryImage.h"#include "Serialization/MemoryLayout.h"#include "Shader.h"#include "ShaderParameterUtils.h"#include "Templates/Tuple.h"#include "Templates/UniquePtr.h"#include "UObject/NameTypes.h"#include "UObject/UnrealNames.h"Go to the source code of this file.
Classes | |
| class | FGlobalShaderMapId |
| struct | FGlobalShaderPermutationParameters |
| class | FGlobalShaderType |
| class | FGlobalShaderMapContent |
| class | FGlobalShaderMapSection |
| class | FGlobalShaderMap |
| class | FGlobalShader |
| class | FNULLPS |
Macros | |
| #define | DECLARE_GLOBAL_SHADER(ShaderClass) DECLARE_SHADER_TYPE(ShaderClass, Global) |
| #define | DECLARE_EXPORTED_GLOBAL_SHADER(ShaderClass, RequiredAPI) DECLARE_EXPORTED_SHADER_TYPE(ShaderClass, Global, RequiredAPI) |
| #define | IMPLEMENT_GLOBAL_SHADER(ShaderClass, SourceFilename, FunctionName, Frequency) IMPLEMENT_SHADER_TYPE(,ShaderClass,TEXT(SourceFilename),TEXT(FunctionName),Frequency) |
Enumerations | |
| enum class | ERecursiveShader { None = 0 , Resolve = 1 << 0 , Clear = 1 << 1 , Null = 1 << 2 } |
Functions | |
| RENDERCORE_API FGlobalShaderMap * | GetGlobalShaderMap (EShaderPlatform Platform) |
| FGlobalShaderMap * | GetGlobalShaderMap (ERHIFeatureLevel::Type FeatureLevel) |
| RENDERCORE_API void | CreateRecursiveShaders () |
| void | ForceInitGlobalShaderType (FShaderType &ShaderType) |
| template<typename TShaderType > | |
| void | ForceInitGlobalShaderType () |
Variables | |
| RENDERCORE_API const int32 | GlobalShaderMapId |
| RENDERCORE_API FGlobalShaderMap * | GGlobalShaderMap [SP_NumPlatforms] |
| RENDERCORE_API ERecursiveShader | GRequiredRecursiveShaders |
| #define DECLARE_EXPORTED_GLOBAL_SHADER | ( | ShaderClass, | |
| RequiredAPI | |||
| ) | DECLARE_EXPORTED_SHADER_TYPE(ShaderClass, Global, RequiredAPI) |
| #define DECLARE_GLOBAL_SHADER | ( | ShaderClass | ) | DECLARE_SHADER_TYPE(ShaderClass, Global) |
DECLARE_GLOBAL_SHADER and IMPLEMENT_GLOBAL_SHADER setup a global shader class's boiler plate. They are meant to be used like so:
class FMyGlobalShaderPS : public FGlobalShader { // Setup the shader's boiler plate. DECLARE_GLOBAL_SHADER(FMyGlobalShaderPS);
// Setup the shader's permutation domain. If no dimensions, can do FPermutationDomain = FShaderPermutationNone. using FPermutationDomain = TShaderPermutationDomain<DIMENSIONS...>;
// ... };
// Instantiates global shader's global variable that will take care of compilation process of the shader. This needs imperatively to be done in a .cpp file regardless of whether FMyGlobalShaderPS is in a header or not. IMPLEMENT_GLOBAL_SHADER(FMyGlobalShaderPS, "/Engine/Private/MyShaderFile.usf", "MainPS", SF_Pixel);
When the shader class is a public header, let say in RenderCore module public header, the class declaration macro then should have the RENDERCORE_API like this:
class FMyGlobalShaderPS : public FGlobalShader { // Setup the shader's boiler plate. DECLARE_EXPORTED_GLOBAL_SHADER(FMyGlobalShaderPS, RENDERCORE_API);
// ... };
| #define IMPLEMENT_GLOBAL_SHADER | ( | ShaderClass, | |
| SourceFilename, | |||
| FunctionName, | |||
| Frequency | |||
| ) | IMPLEMENT_SHADER_TYPE(,ShaderClass,TEXT(SourceFilename),TEXT(FunctionName),Frequency) |
|
strong |
|
extern |
|
inline |
| void ForceInitGlobalShaderType | ( | FShaderType & | ShaderType | ) |
|
inline |
Overload for the above GetGlobalShaderMap which takes a feature level and translates to the appropriate shader platform
| FeatureLevel | - Which feature levels shader map to use |
| bRefreshShaderMap | If true, the existing global shader map will be tossed first |
|
extern |
Accesses the global shader map. This is a global FGlobalShaderMap which contains an instance of each global shader type.
| Platform | Which platform's global shader map to use |
| bRefreshShaderMap | If true, the existing global shader map will be tossed first |
|
extern |
The global shader map.
|
extern |
Used to identify the global shader map in compile queues.
|
extern |