UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RHIShaderPlatform.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "RHIDefinitions.h"
7#include "HAL/Platform.h"
8
11{
14 SP_METAL UE_DEPRECATED(5.6, "Use SP_METAL_ES3_1_IOS enumeration value instead.") = SP_METAL_ES3_1_IOS,
16 SP_METAL_MRT UE_DEPRECATED(5.6, "Use SP_METAL_SM5_IOS enumeration value instead.") = SP_METAL_SM5_IOS,
24 SP_METAL_MACES3_1 UE_DEPRECATED(5.6, "Use SP_METAL_ES3_1 enumeration value instead.") = SP_METAL_ES3_1,
27 SP_METAL_TVOS UE_DEPRECATED(5.6, "Use SP_METAL_ES3_1_TVOS enumeration value instead.") = SP_METAL_ES3_1_TVOS,
29 SP_METAL_MRT_TVOS UE_DEPRECATED(5.6, "Use SP_METAL_SM5_TVOS enumeration value instead.") = SP_METAL_SM5_TVOS,
30 /**********************************************************************************/
31 /* !! Do not add any new platforms here. Add them below SP_StaticPlatform_Last !! */
32 /**********************************************************************************/
33
34 //---------------------------------------------------------------------------------
36#define DDPI_NUM_STATIC_SHADER_PLATFORMS 16
38
39 // Platform specific shaders are now stored in platform specific files called <platform>RHIShaderPlatform.h
40 // These files are generated by UBT and can be included the same way as this file
41
43
44 // Add new platforms below this line, starting from (SP_StaticPlatform_Last + 1)
45 //---------------------------------------------------------------------------------
51
54
57};
58static_assert(SP_NumPlatforms <= (1 << SP_NumBits), "SP_NumPlatforms will not fit on SP_NumBits");
59
60#if USE_STATIC_SHADER_PLATFORM_ENUMS
61#include COMPILED_PLATFORM_HEADER_GENERATED(RHIShaderPlatform.h)
62#include COMPILED_PLATFORM_HEADER(StaticShaderPlatform.inl)
63#else
64struct FStaticShaderPlatform final
65{
67 inline operator EShaderPlatform() const
68 {
69 return Platform;
70 }
71
72 inline bool operator == (const EShaderPlatform Other) const
73 {
74 return Other == Platform;
75 }
76 inline bool operator != (const EShaderPlatform Other) const
77 {
78 return Other != Platform;
79 }
80private:
81 const EShaderPlatform Platform;
82};
83#endif
84
85// The maximum shader platform available on this system
87
89{
90 checkf(!IsRunningCookCommandlet(), TEXT("Calling GetMaxShaderPlatformChecked while inside a cook commandlet is not correct, as it will return the cookers GMaxRHIShaderPlatform and not the ShaderPlatform you are cooking for"));
92}
93
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
FORCEINLINE bool IsRunningCookCommandlet()
Definition CoreGlobals.h:259
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EShaderPlatform
Definition RHIShaderPlatform.h:11
@ SP_NumBits
Definition RHIShaderPlatform.h:56
@ SP_CUSTOM_PLATFORM_FIRST
Definition RHIShaderPlatform.h:52
@ SP_StaticPlatform_First
Definition RHIShaderPlatform.h:37
@ SP_METAL_ES3_1
Definition RHIShaderPlatform.h:23
@ SP_OPENGL_PCES3_1
Definition RHIShaderPlatform.h:18
@ SP_METAL_ES3_1_IOS
Definition RHIShaderPlatform.h:13
@ SP_VULKAN_SM5_ANDROID
Definition RHIShaderPlatform.h:46
@ SP_METAL_ES3_1_TVOS
Definition RHIShaderPlatform.h:26
@ SP_VULKAN_ES3_1_ANDROID
Definition RHIShaderPlatform.h:22
@ SP_PCD3D_SM6
Definition RHIShaderPlatform.h:47
@ UE_DEPRECATED
Definition RHIShaderPlatform.h:14
@ SP_METAL_SM5_IOS
Definition RHIShaderPlatform.h:15
@ SP_VULKAN_SM5
Definition RHIShaderPlatform.h:21
@ SP_StaticPlatform_Last
Definition RHIShaderPlatform.h:42
@ SP_PCD3D_SM5
Definition RHIShaderPlatform.h:12
@ SP_METAL_SM5
Definition RHIShaderPlatform.h:19
@ SP_CUSTOM_PLATFORM_LAST
Definition RHIShaderPlatform.h:53
@ SP_VULKAN_PCES3_1
Definition RHIShaderPlatform.h:20
@ SP_METAL_SM5_TVOS
Definition RHIShaderPlatform.h:28
@ SP_METAL_SIM
Definition RHIShaderPlatform.h:50
@ SP_PCD3D_ES3_1
Definition RHIShaderPlatform.h:17
@ SP_OPENGL_ES3_1_ANDROID
Definition RHIShaderPlatform.h:25
@ SP_NumPlatforms
Definition RHIShaderPlatform.h:55
@ SP_METAL_SM6
Definition RHIShaderPlatform.h:49
@ SP_VULKAN_SM6
Definition RHIShaderPlatform.h:48
EShaderPlatform GetMaxShaderPlatformChecked()
Definition RHIShaderPlatform.h:88
#define DDPI_NUM_STATIC_SHADER_PLATFORMS
Definition RHIShaderPlatform.h:36
RHI_API EShaderPlatform GMaxRHIShaderPlatform
Definition RHI.cpp:1335
bool IsCustomPlatform(const FStaticShaderPlatform Platform)
Definition RHIShaderPlatform.h:94
uint16_t uint16
Definition binka_ue_file_header.h:7
Definition AndroidStaticShaderPlatform.inl:18
bool operator==(const EShaderPlatform Other) const
Definition AndroidStaticShaderPlatform.inl:29
FStaticShaderPlatform(const EShaderPlatform InPlatform)
Definition RHIShaderPlatform.h:66
bool operator!=(const EShaderPlatform Other) const
Definition AndroidStaticShaderPlatform.inl:34