![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "Algo/BinarySearch.h"#include "Containers/Array.h"#include "Containers/ArrayView.h"#include "Containers/ContainersFwd.h"#include "Containers/EnumAsByte.h"#include "Containers/HashTable.h"#include "Containers/List.h"#include "Containers/Map.h"#include "Containers/Set.h"#include "Containers/StringFwd.h"#include "Containers/UnrealString.h"#include "CoreMinimal.h"#include "CoreTypes.h"#include "HAL/CriticalSection.h"#include "HAL/PlatformCrt.h"#include "HAL/ThreadSafeBool.h"#include "HAL/UnrealMemory.h"#include "Math/NumericLimits.h"#include "Misc/AssertionMacros.h"#include "Misc/CString.h"#include "Misc/EnumClassFlags.h"#include "Misc/ScopeLock.h"#include "Misc/SecureHash.h"#include "RHI.h"#include "RHIDefinitions.h"#include "RHIMemoryLayout.h"#include "RenderResource.h"#include "RenderDeferredCleanup.h"#include "Serialization/Archive.h"#include "Serialization/ArchiveProxy.h"#include "Serialization/MemoryImage.h"#include "Serialization/MemoryLayout.h"#include "ShaderCore.h"#include "ShaderParameterMetadata.h"#include "ShaderParameters.h"#include "ShaderPermutation.h"#include "ShaderPermutationUtils.h"#include "Templates/RefCounting.h"#include "Templates/TypeHash.h"#include "Templates/UniquePtr.h"#include "Templates/UnrealTemplate.h"#include "Templates/UnrealTypeTraits.h"#include "UObject/NameTypes.h"#include "UObject/RenderingObjectVersion.h"#include <atomic>Go to the source code of this file.
Namespaces | |
| namespace | Freeze |
Typedefs | |
| using | FShaderMapAssetPaths = TSet< FName > |
| using | FShaderPermutation = TShaderTypePermutation< FShaderType > |
| typedef uint32(* | TRaytracingPayloadSizeFunction) () |
| template<typename ShaderType > | |
| using | TShaderRef = TShaderRefBase< ShaderType, FShaderMapPointerTable > |
Enumerations | |
| enum class | EShaderPermutationPrecacheRequest : uint8 { Precached , NotPrecached , NotUsed } |
Variables | |
| const int32 | kUniqueShaderPermutationId = 0 |
| #define DECLARE_EXPORTED_SHADER_TYPE | ( | ShaderClass, | |
| ShaderMetaTypeShortcut, | |||
| RequiredAPI, | |||
| ... | |||
| ) |
A macro to declare a new shader type. This should be called in the class body of the new shader type.
| ShaderClass | - The name of the class representing an instance of the shader type. |
| ShaderMetaTypeShortcut | - The shortcut for the shader meta type: simple, material, meshmaterial, etc. The shader meta type controls |
| #define DECLARE_SHADER_TYPE | ( | ShaderClass, | |
| ShaderMetaTypeShortcut, | |||
| ... | |||
| ) | DECLARE_EXPORTED_SHADER_TYPE(ShaderClass,ShaderMetaTypeShortcut,, ##__VA_ARGS__) |
| #define DECLARE_SHADER_TYPE_EXPLICIT_BASES | ( | ShaderClass, | |
| ShaderMetaTypeShortcut, | |||
| ... | |||
| ) |
| #define IMPLEMENT_RT_PAYLOAD_TYPE | ( | PayloadType, | |
| PayloadSize | |||
| ) | static FRegisterRayTracingPayloadTypeHelper IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT(PayloadHelper, __COUNTER__) = FRegisterRayTracingPayloadTypeHelper(PayloadType, PayloadSize, nullptr); |
| #define IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT | ( | x, | |
| y | |||
| ) | IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT2( x, y ) |
| #define IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT2 | ( | x, | |
| y | |||
| ) | x##y |
| #define IMPLEMENT_RT_PAYLOAD_TYPE_FUNCTION | ( | PayloadType, | |
| PayloadSizeFunction | |||
| ) | static FRegisterRayTracingPayloadTypeHelper IMPLEMENT_RT_PAYLOAD_TYPE_CONCAT(PayloadHelper, __COUNTER__) = FRegisterRayTracingPayloadTypeHelper(PayloadType, 0u, PayloadSizeFunction); |
| #define IMPLEMENT_SHADER_TYPE | ( | TemplatePrefix, | |
| ShaderClass, | |||
| SourceFilename, | |||
| FunctionName, | |||
| Frequency | |||
| ) |
A macro to implement a shader type.
| #define IMPLEMENT_SHADER_TYPE2 | ( | ShaderClass, | |
| Frequency | |||
| ) | IMPLEMENT_SHADER_TYPE2_WITH_TEMPLATE_PREFIX(template<>, ShaderClass, Frequency) |
| #define IMPLEMENT_SHADER_TYPE2_WITH_TEMPLATE_PREFIX | ( | TemplatePrefix, | |
| ShaderClass, | |||
| Frequency | |||
| ) |
A macro to implement a templated shader type, the function name and the source filename comes from the class.
todo: this should replace IMPLEMENT_SHADER_TYPE
| #define IMPLEMENT_SHADER_TYPE4_WITH_TEMPLATE_PREFIX | ( | TemplatePrefix, | |
| RequiredAPI, | |||
| ShaderClass, | |||
| Frequency | |||
| ) |
| #define IMPLEMENT_SHADER_TYPE_CONSTRUCTOR | ( | ShaderClass, | |
| InShaderTypeForDynamicCast, | |||
| InShaderClassUserFriendlyName | |||
| ) |
| #define IMPLEMENT_SHADER_TYPE_WITH_DEBUG_NAME | ( | TemplatePrefix, | |
| ShaderClass, | |||
| SourceFilename, | |||
| FunctionName, | |||
| Frequency | |||
| ) |
A macro to implement a shader type. Shader name is got from GetDebugName(), which is helpful for templated shaders.
| #define IMPLEMENT_SHADERPIPELINE_TYPE_MSASPS | ( | PipelineName, | |
| MeshShaderType, | |||
| AmplificationShaderType, | |||
| PixelShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &MeshShaderType::GetStaticType(), &AmplificationShaderType::GetStaticType(), &PixelShaderType::GetStaticType(), true, bRemoveUnused); |
| #define IMPLEMENT_SHADERPIPELINE_TYPE_MSPS | ( | PipelineName, | |
| MeshShaderType, | |||
| PixelShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &MeshShaderType::GetStaticType(), nullptr, &PixelShaderType::GetStaticType(), true, bRemoveUnused); |
| #define IMPLEMENT_SHADERPIPELINE_TYPE_VS | ( | PipelineName, | |
| VertexShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), nullptr, nullptr, false, bRemoveUnused); |
| #define IMPLEMENT_SHADERPIPELINE_TYPE_VSGS | ( | PipelineName, | |
| VertexShaderType, | |||
| GeometryShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), &GeometryShaderType::GetStaticType(), nullptr, false, bRemoveUnused); |
| #define IMPLEMENT_SHADERPIPELINE_TYPE_VSGSPS | ( | PipelineName, | |
| VertexShaderType, | |||
| GeometryShaderType, | |||
| PixelShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), &GeometryShaderType::GetStaticType(), &PixelShaderType::GetStaticType(), false, bRemoveUnused); |
| #define IMPLEMENT_SHADERPIPELINE_TYPE_VSPS | ( | PipelineName, | |
| VertexShaderType, | |||
| PixelShaderType, | |||
| bRemoveUnused | |||
| ) | static FShaderPipelineType PipelineName(TEXT(PREPROCESSOR_TO_STRING(PipelineName)), &VertexShaderType::GetStaticType(), nullptr, &PixelShaderType::GetStaticType(), false, bRemoveUnused); |
| #define INTERNAL_DECLARE_SHADER_TYPE_COMMON | ( | ShaderClass, | |
| ShaderMetaTypeShortcut, | |||
| RequiredAPI | |||
| ) |
| #define SHADER_DECLARE_EDITOR_VTABLE | ( | ShaderClass | ) |
| #define SHADER_DECLARE_VTABLE | ( | ShaderClass | ) |
| #define SHADER_TYPE_EDITOR_PERMUTATION_METADATA | ( | ShaderClass | ) |
| #define SHADER_TYPE_EDITOR_VTABLE | ( | ShaderClass | ) |
| #define SHADER_TYPE_LIST |
| #define SHADER_TYPE_VTABLE | ( | ShaderClass | ) |
| using FShaderMapAssetPaths = TSet<FName> |
| using TShaderRef = TShaderRefBase<ShaderType, FShaderMapPointerTable> |
|
strong |
| DECLARE_DELEGATE_EightParams | ( | FShaderListReport | , |
| const TCHAR * | , | ||
| const TCHAR * | , | ||
| const TCHAR * | , | ||
| const TCHAR * | , | ||
| uint32 | , | ||
| uint32 | , | ||
| const TCHAR * | , | ||
| void * | |||
| ) |
| DECLARE_EXPORTED_TEMPLATE_INTRINSIC_TYPE_LAYOUT | ( | template<> | , |
| TIndexedPtr< FShaderType > | , | ||
| RENDERCORE_API | |||
| ) |
| DECLARE_EXPORTED_TEMPLATE_INTRINSIC_TYPE_LAYOUT | ( | template<> | , |
| TIndexedPtr< FVertexFactoryType > | , | ||
| RENDERCORE_API | |||
| ) |
|
inline |
|
extern |
Helper function to dispatch a compute shader while checking that parameters have been set correctly.
|
extern |
Helper function to dispatch a compute shader indirectly while checking that parameters have been set correctly.
|
extern |
Dumps shader pipeline stats to the log. Does not include material (eg shader pipeline instance) information.
| Platform | - Platform to dump shader info for, use SP_NumPlatforms for all |
|
extern |
Dumps shader stats to the log. Will also print some shader pipeline information.
| Platform | - Platform to dump shader info for, use SP_NumPlatforms for all |
| Frequency | - Whether to dump PS or VS info, use SF_NumFrequencies to dump both |
| ENUM_CLASS_FLAGS | ( | ERayTracingPayloadType | ) |
|
extern |
Finds the shader type with a given name.
| ShaderTypeName | - The name of the shader type to find. |
|
inline |
|
inline |
|
inline |
| RENDERCORE_API uint32 GetRayTracingPayloadTypeMaxSize | ( | ERayTracingPayloadType | PayloadType | ) |
| RENDERCORE_API EShaderPermutationFlags GetShaderPermutationFlags | ( | const FPlatformTypeLayoutParameters & | LayoutParams | ) |
Get the shader permutation flags associated with a platform layout.
| RENDERCORE_API const FTypeLayoutDesc & GetTypeLayoutDesc | ( | const FPointerTableBase * | PtrTable, |
| const FShader & | Shader | ||
| ) |
|
extern |
Returns whether DirectXShaderCompiler (DXC) is enabled for the specified shader platform. See console variables "r.OpenGL.ForceDXC", "r.D3D.ForceDXC".
|
extern |
Returns whether the platform is using emulated uniform buffers
|
inline |
|
inline |
| RENDERCORE_API void RegisterRayTracingPayloadType | ( | ERayTracingPayloadType | PayloadType, |
| uint32 | PayloadSize, | ||
| TRaytracingPayloadSizeFunction | PayloadSizeFunction | ||
| ) |
| RENDERCORE_API void SetAdditionalShaderPermutationFlags | ( | EShaderPermutationFlags | AdditionalFlags | ) |
Set global additional flags that are always added in GetShaderPermutationFlags(). Expected to be called once at startup.
|
extern |
|
extern |
Appends to KeyString for all shaders.
|
inline |