UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RHIDefinitions.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 RHIDefinitions.h: Render Hardware Interface definitions
5 (that don't require linking).
6=============================================================================*/
7
8#pragma once
9
10#include "Math/NumericLimits.h"
12#include "Misc/EnumClassFlags.h"
13#include "ProfilingDebugging/CsvProfilerConfig.h" // TODO Move defines into RHIDefinitions
14#include "UObject/NameTypes.h"
16
17#ifndef USE_STATIC_SHADER_PLATFORM_ENUMS
18#define USE_STATIC_SHADER_PLATFORM_ENUMS 0
19#endif
20
23
25#define SHADER_PARAMETER_STRUCT_ALIGNMENT 16
26
28#define SHADER_PARAMETER_ARRAY_ELEMENT_ALIGNMENT 16
29
31#define RHI_RAW_VIEW_ALIGNMENT 16
32
33// RHICreateUniformBuffer assumes C++ constant layout matches the shader layout when extracting float constants, yet the C++ struct contains pointers.
34// Enforce a min size of 64 bits on pointer types in uniform buffer structs to guarantee layout matching between languages.
35#define SHADER_PARAMETER_POINTER_ALIGNMENT sizeof(uint64)
36static_assert(sizeof(void*) <= SHADER_PARAMETER_POINTER_ALIGNMENT, "The alignment of pointer needs to match the largest pointer.");
37
38// Support platforms which require indirect dispatch arguments to not cross memory boundaries
39#ifndef PLATFORM_DISPATCH_INDIRECT_ARGUMENT_BOUNDARY_SIZE
40 #define PLATFORM_DISPATCH_INDIRECT_ARGUMENT_BOUNDARY_SIZE 0
41#endif
42
43#ifndef USE_STATIC_SHADER_PLATFORM_INFO
44#define USE_STATIC_SHADER_PLATFORM_INFO 0
45#endif
46
47
48#ifndef RHI_USE_RESOURCE_DEBUG_NAME
49#if (UE_BUILD_SHIPPING || UE_BUILD_TEST)
50 #define RHI_USE_RESOURCE_DEBUG_NAME 0
51#else
52 #define RHI_USE_RESOURCE_DEBUG_NAME 1
53#endif
54#endif
55
56#ifndef RHI_USE_SYNC_POINT_DEBUG_NAME
57#if (UE_BUILD_SHIPPING)
58#define RHI_USE_SYNC_POINT_DEBUG_NAME 0
59#else
60#define RHI_USE_SYNC_POINT_DEBUG_NAME 1
61#endif
62#endif
63
64#ifndef RHI_RAYTRACING
65#define RHI_RAYTRACING 0
66#endif
67
68#ifndef RHI_NEW_GPU_PROFILER
69#define RHI_NEW_GPU_PROFILER 1
70#endif
71
72#ifndef GPUPROFILERTRACE_ENABLED
73#if UE_TRACE_ENABLED && !UE_BUILD_SHIPPING
74// The trace implementation for the old GPU Profiler (FGpuProfilerTrace API) is deprecated in UE 5.6.
75// The new GPU Profiler has a different trace implementation (see UE_TRACE_GPU_PROFILER_ENABLED and FGPUProfilerSink_Trace).
76#define GPUPROFILERTRACE_ENABLED !RHI_NEW_GPU_PROFILER
77#else
78#define GPUPROFILERTRACE_ENABLED 0
79#endif
80#endif
81
82#ifndef HAS_GPU_STATS
83#define HAS_GPU_STATS ((STATS || CSV_PROFILER_STATS || GPUPROFILERTRACE_ENABLED) && (!UE_BUILD_SHIPPING))
84#endif
85
95{
96public:
97 // Buffer size required for any null-terminated FDebugName string, i.e. [name] '_' [digits] '\0'
98 static constexpr uint32 StringBufferSize = FName::StringBufferSize + 1 + 10;
99
101 RHI_API FDebugName(FName InName);
103
105
106 RHI_API FString ToString() const;
107
109 "FDebugName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided "
110 "buffer is smaller than FDebugName::StringBufferSize, even if the OutSize parameter indicates the buffer is "
111 "smaller than this value. Use the templated ToString() or ToStringTruncate() functions to format the name "
112 "string into a pre-allocated array, or use the allocating ToString() function that returns an FString.")
114 {
117 }
118
123 template <uint32 N>
124 uint32 ToString(TCHAR(&Out)[N]) const
125 {
127 "FDebugName::ToString(TCHAR (&Out)[N]) requires a buffer of size of at least FDebugName::StringBufferSize. "
128 "Use ToStringTruncate() if a smaller buffer is required and it is safe for the returned string to be truncated.");
129
130 return ToStringInternal(Out, N);
131 }
132
139 template <uint32 N>
141 {
142 static_assert(N > 0, "Out buffer must have at least one element.");
143 return ToStringInternal(Out, N);
144 }
145
146 bool IsNone() const { return Name.IsNone() && Number == NAME_NO_NUMBER_INTERNAL; }
147 RHI_API void AppendString(FStringBuilderBase& Builder) const;
148
149private:
150 FName Name;
151 uint32 Number;
152
154};
155
157{
158 Hidden,
159 Null,
160 D3D11,
161 D3D12,
162 Vulkan,
163 Metal,
164 Agx,
165 OpenGL,
166};
167
169{
170 // The RHI feature is completely unavailable at runtime
172
173 // The RHI feature can be available at runtime based on hardware or driver
175
176 // The RHI feature is guaranteed to be available at runtime.
178
179 Num,
180 NumBits = 2,
181};
182
183enum class UE_DEPRECATED(5.7, "ERHIBindlessSupport is not used anymore, it is now a boolean") ERHIBindlessSupport : uint8
184{
188
189 NumBits = 2
190};
191
200
202{
215
217
218 // Number of standard shader frequencies for graphics pipeline (excluding compute)
220
221 // Number of standard shader frequencies (including compute)
223
225};
226static_assert(SF_NumFrequencies <= (1 << SF_NumBits), "SF_NumFrequencies will not fit on SF_NumBits");
227
229{
230 switch (InShaderFrequency)
231 {
232 case SF_Vertex: return true;
233#if PLATFORM_SUPPORTS_MESH_SHADERS
234 case SF_Mesh: return true;
235 case SF_Amplification: return true;
236#endif
237 case SF_Pixel: return true;
238 case SF_Geometry: return true;
239 }
240 return false;
241}
242
243inline bool IsComputeShaderFrequency(EShaderFrequency ShaderFrequency)
244{
245 switch (ShaderFrequency)
246 {
247 case SF_Compute:
248 case SF_RayGen:
249 case SF_RayMiss:
250 case SF_RayHitGroup:
251 case SF_RayCallable:
252 return true;
253 }
254 return false;
255}
256
258{
259 // e.g. WaitForFrameEventCompletion()
261 // Result is the number of samples that are not culled (divide by MSAACount to get pixels)
263 // Result is current time in micro seconds = 1/1000 ms = 1/1000000 sec (not a duration).
265};
266
269
272
274enum
275{
278};
279static_assert(MaxVertexElementCount <= (1 << MaxVertexElementCount_NumBits), "MaxVertexElementCount will not fit on MaxVertexElementCount_NumBits");
280
283
285enum
286{
289};
290static_assert(MaxSimultaneousRenderTargets <= (1 << MaxSimultaneousRenderTargets_NumBits), "MaxSimultaneousRenderTargets will not fit on MaxSimultaneousRenderTargets_NumBits");
291
293enum
294{
295 MaxSimultaneousUAVs UE_DEPRECATED(5.6, "Do not use MaxSimultaneousUAVs, this is now device reported by GRHIGlobals.MaxSimultaneousUAVs") = 8
297
298enum class ERHIZBuffer
299{
300 // Before changing this, make sure all math & shader assumptions are correct! Also wrap your C++ assumptions with
301 // static_assert(ERHIZBuffer::IsInvertedZBuffer(), ...);
302 // Shader-wise, make sure to update Definitions.usf, HAS_INVERTED_Z_BUFFER
303 FarPlane = 0,
304 NearPlane = 1,
305
306 // 'bool' for knowing if the API is using Inverted Z buffer
308};
309
310
315{
316 enum Type : int
317 {
321 Num
322 };
323}
324
336static_assert(ESamplerFilter_Num <= (1 << ESamplerFilter_NumBits), "ESamplerFilter_Num will not fit on ESamplerFilter_NumBits");
337
349static_assert(ESamplerAddressMode_Num <= (1 << ESamplerAddressMode_NumBits), "ESamplerAddressMode_Num will not fit on ESamplerAddressMode_NumBits");
350
356
366static_assert(ERasterizerFillMode_Num <= (1 << ERasterizerFillMode_NumBits), "ERasterizerFillMode_Num will not fit on ERasterizerFillMode_NumBits");
367
377static_assert(ERasterizerCullMode_Num <= (1 << ERasterizerCullMode_NumBits), "ERasterizerCullMode_Num will not fit on ERasterizerCullMode_NumBits");
378
380{
381 DepthClip,
383
384 Num,
385 NumBits = 1,
386};
387static_assert(uint32(ERasterizerDepthClipMode::Num) <= (1U << uint32(ERasterizerDepthClipMode::NumBits)), "ERasterizerDepthClipMode::Num will not fit on ERasterizerDepthClipMode::NumBits");
388
404
425static_assert(ECompareFunction_Num <= (1 << ECompareFunction_NumBits), "ECompareFunction_Num will not fit on ECompareFunction_NumBits");
426
441
456static_assert(EStencilOp_Num <= (1 << EStencilOp_NumBits), "EStencilOp_Num will not fit on EStencilOp_NumBits");
457
469static_assert(EBlendOperation_Num <= (1 << EBlendOperation_NumBits), "EBlendOperation_Num will not fit on EBlendOperation_NumBits");
470
493static_assert(EBlendFactor_Num <= (1 << EBlendFactor_NumBits), "EBlendFactor_Num will not fit on EBlendFactor_NumBits");
494
496{
502 VET_PackedNormal, // FPackedNormal
508 VET_Short2N, // 16 bit word normalized to (value/32767.0,value/32767.0,0,0,1)
509 VET_Half2, // 16 bit float using 1 bit sign, 5 bit exponent, 10 bit mantissa
511 VET_Short4N, // 4 X 16 bit word, normalized
514 VET_UShort2N, // 16 bit word normalized to (value/65535.0,value/65535.0,0,0,1)
515 VET_UShort4N, // 4 X 16 bit word unsigned, normalized
516 VET_URGB10A2N, // 10 bit r, g, b and 2 bit a normalized to (value/1023.0f, value/1023.0f, value/1023.0f, value/3.0f)
519
521};
522static_assert(VET_MAX <= (1 << VET_NumBits), "VET_MAX will not fit on VET_NumBits");
523
534
536{
537 // the uniform buffer is temporary, used for a single draw call then discarded
539 // the uniform buffer is used for multiple draw calls but only for the current frame
541 // the uniform buffer is used for multiple draw calls, possibly across multiple frames
543};
544
546{
547 None,
549};
550
553{
554 Invalid,
555
557
558 // Texture1D: not used in the renderer.
559 // Texture1DArray: not used in the renderer.
560 Texture2D,
563 Texture3D,
564 // Texture3DArray: not used in the renderer.
568
569 Buffer,
573
574 // RWTexture1D: not used in the renderer.
575 // RWTexture1DArray: not used in the renderer.
579 // RWTexture3DArray: not used in the renderer.
581 // RWTextureCubeArray: not used in the renderer.
583
584 RWBuffer,
587
589
591
592 MAX
593};
594
596{
597 switch (Type)
598 {
610 return true;
622 return false;
625 default:
626 ensureMsgf(0, TEXT("Missing or invalid SRV or UAV Type"));
627 }
628
629 return false;
630}
631
634{
636
637 // Invalid type when trying to use bool, to have explicit error message to programmer on why
638 // they shouldn't use bool in shader parameter structures.
640
641 // Parameter types.
645
646 // RHI resources not tracked by render graph.
651
652 // Resources tracked by render graph.
664
665 // Nested structure.
667
668 // Structure that is nested on C++ side, but included on shader side.
670
671 // GPU Indirection reference of struct, like is currently named Uniform buffer.
673
674 // Structure dedicated to setup render targets for a rasterizer pass.
676
678
681};
682static_assert(EUniformBufferBaseType_Num <= (1 << EUniformBufferBaseType_NumBits), "EUniformBufferBaseType_Num will not fit on EUniformBufferBaseType_NumBits");
683
686{
688 Shader = 1 << 0,
689
691 Static = 1 << 1,
692
699};
701
704{
705 None = 0,
706
709
711 NeedsReflectedMembers = 1 << 1,
712
714 HasNonGraphOutputs = 1 << 2,
715
717 UniformView = 1 << 3,
718};
720
723
724enum
725{
729
735
737{
738public:
739 static constexpr uint32 GetEndOfStreamToken()
740 {
741 return 0xffffffff;
742 }
743
745 {
746 return ((UniformBufferIndex & RTD_Mask_UniformBufferIndex) << RTD_Shift_UniformBufferIndex) |
747 ((ResourceIndex & RTD_Mask_ResourceIndex) << RTD_Shift_ResourceIndex) |
748 ((BindIndex & RTD_Mask_BindIndex) << RTD_Shift_BindIndex);
749 }
750
752 {
753 return (Data >> RTD_Shift_UniformBufferIndex) & RTD_Mask_UniformBufferIndex;
754 }
755
756 static inline uint16 GetResourceIndex(uint32 Data)
757 {
758 return (Data >> RTD_Shift_ResourceIndex) & RTD_Mask_ResourceIndex;
759 }
760
761 static inline uint16 GetBindIndex(uint32 Data)
762 {
763 return (Data >> RTD_Shift_BindIndex) & RTD_Mask_BindIndex;
764 }
765
766private:
767 enum EResourceTableDefinitions
768 {
769 RTD_NumBits_UniformBufferIndex = 8,
770 RTD_NumBits_ResourceIndex = 16,
771 RTD_NumBits_BindIndex = 8,
772
773 RTD_Mask_UniformBufferIndex = (1 << RTD_NumBits_UniformBufferIndex) - 1,
774 RTD_Mask_ResourceIndex = (1 << RTD_NumBits_ResourceIndex) - 1,
775 RTD_Mask_BindIndex = (1 << RTD_NumBits_BindIndex) - 1,
776
777 RTD_Shift_BindIndex = 0,
778 RTD_Shift_ResourceIndex = RTD_Shift_BindIndex + RTD_NumBits_BindIndex,
779 RTD_Shift_UniformBufferIndex = RTD_Shift_ResourceIndex + RTD_NumBits_ResourceIndex,
780 };
781 static_assert(RTD_NumBits_UniformBufferIndex + RTD_NumBits_ResourceIndex + RTD_NumBits_BindIndex <= sizeof(uint32)* 8, "RTD_* values must fit in 32 bits");
782};
783
791
793// RCM_UNorm is the default
794// RCM_MinMax means "leave the values alone" and is recommended as what you should use
795// RCM_SNorm and RCM_MinMaxNorm seem to be unsupported
797{
798 // 0 .. 1
799 RCM_UNorm, // if you read values that go outside [0,1], they are scaled to fit inside [0,1]
800 // -1 .. 1
802 // 0 .. 1 unless there are smaller values than 0 or bigger values than 1, then the range is extended to the minimum or the maximum of the values
804 // minimum .. maximum (each channel independent)
805 RCM_MinMax, // read values without changing them
806};
807
809{
810 Triangle,
811 Patch,
812 Line,
813 Point,
814 //Quad,
815
816 Num,
817 NumBits = 2,
818};
819static_assert((uint32)EPrimitiveTopologyType::Num <= (1 << (uint32)EPrimitiveTopologyType::NumBits), "EPrimitiveTopologyType::Num will not fit on EPrimitiveTopologyType::NumBits");
820
822{
823 // Topology that defines a triangle N with 3 vertex extremities: 3*N+0, 3*N+1, 3*N+2.
825
826 // Topology that defines a triangle N with 3 vertex extremities: N+0, N+1, N+2.
828
829 // Topology that defines a line with 2 vertex extremities: 2*N+0, 2*N+1.
831
832 // Topology that defines a quad N with 4 vertex extremities: 4*N+0, 4*N+1, 4*N+2, 4*N+3.
833 // Supported only if GRHISupportsQuadTopology == true.
835
836 // Topology that defines a point N with a single vertex N.
838
839 // Topology that defines a screen aligned rectangle N with only 3 vertex corners:
840 // 3*N + 0 is upper-left corner,
841 // 3*N + 1 is upper-right corner,
842 // 3*N + 2 is the lower-left corner.
843 // Supported only if GRHISupportsRectTopology == true.
845
847 PT_NumBits = 3
849static_assert(PT_Num <= (1 << 8), "EPrimitiveType doesn't fit in a byte");
850static_assert(PT_Num <= (1 << PT_NumBits), "PT_NumBits is too small");
851
858
871
880
882{
883 VRSImage_NotSupported, // Image-based Variable Rate Shading is not supported on the current device/platform.
884 VRSImage_Palette, // Image-based VRS uses a palette of discrete, enumerated values to describe shading rate per tile.
885 VRSImage_Fractional, // Image-based VRS uses a floating point value to describe shading rate in X/Y (e.g. 1.0f is full rate, 0.5f is half-rate, 0.25f is 1/4 rate, etc).
886};
887
892{
893 None = 0,
894
896 Static = 1 << 0,
897
899 Dynamic = 1 << 1,
900
902 Volatile = 1 << 2,
903
905 UnorderedAccess = 1 << 3,
906
908 ByteAddressBuffer = 1 << 4,
909
911 SourceCopy = 1 << 5,
912
913 UNUSED_BIT_6 = 1 << 6,
914
916 DrawIndirect = 1 << 7,
917
922 ShaderResource = 1 << 8,
923
925 KeepCPUAccessible = 1 << 9,
926
928 FastVRAM = 1 << 10,
929
931 NNE = 1 << 11,
932
934 Shared = 1 << 12,
935
941 AccelerationStructure = 1 << 13,
942
943 VertexBuffer = 1 << 14,
944 IndexBuffer = 1 << 15,
945 StructuredBuffer = 1 << 16,
946
948 MultiGPUAllocate = 1 << 17,
949
955 MultiGPUGraphIgnore = 1 << 18,
956
961
963 NullResource = 1 << 20,
964
966 UniformBuffer = 1 << 21,
967
972 ReservedResource = 1 << 22,
973
974 // Helper bit-masks
976};
978
979#define BUF_None EBufferUsageFlags::None
980#define BUF_Static EBufferUsageFlags::Static
981#define BUF_Dynamic EBufferUsageFlags::Dynamic
982#define BUF_Volatile EBufferUsageFlags::Volatile
983#define BUF_UnorderedAccess EBufferUsageFlags::UnorderedAccess
984#define BUF_ByteAddressBuffer EBufferUsageFlags::ByteAddressBuffer
985#define BUF_SourceCopy EBufferUsageFlags::SourceCopy
986#define BUF_StreamOutput EBufferUsageFlags::StreamOutput
987#define BUF_DrawIndirect EBufferUsageFlags::DrawIndirect
988#define BUF_ShaderResource EBufferUsageFlags::ShaderResource
989#define BUF_KeepCPUAccessible EBufferUsageFlags::KeepCPUAccessible
990#define BUF_FastVRAM EBufferUsageFlags::FastVRAM
991#define BUF_Transient EBufferUsageFlags::Transient
992#define BUF_Shared EBufferUsageFlags::Shared
993#define BUF_AccelerationStructure EBufferUsageFlags::AccelerationStructure
994#define BUF_RayTracingScratch EBufferUsageFlags::RayTracingScratch
995#define BUF_VertexBuffer EBufferUsageFlags::VertexBuffer
996#define BUF_IndexBuffer EBufferUsageFlags::IndexBuffer
997#define BUF_StructuredBuffer EBufferUsageFlags::StructuredBuffer
998#define BUF_AnyDynamic EBufferUsageFlags::AnyDynamic
999#define BUF_MultiGPUAllocate EBufferUsageFlags::MultiGPUAllocate
1000#define BUF_MultiGPUGraphIgnore EBufferUsageFlags::MultiGPUGraphIgnore
1001#define BUF_NullResource EBufferUsageFlags::NullResource
1002#define BUF_UniformBuffer EBufferUsageFlags::UniformBuffer
1003#define BUF_ReservedResource EBufferUsageFlags::ReservedResource
1004
1006{
1007 Unknown = 0xffffffff,
1008 NotQueried = 0,
1009
1010 Amd = 0x1002,
1011 ImgTec = 0x1010,
1012 Nvidia = 0x10DE,
1013 Arm = 0x13B5,
1014 Broadcom = 0x14E4,
1015 Qualcomm = 0x5143,
1016 Intel = 0x8086,
1017 Apple = 0x106B,
1018 Vivante = 0x7a05,
1019 VeriSilicon = 0x1EB1,
1020 SamsungAMD = 0x144D,
1021 Microsoft = 0x1414,
1022
1023 Kazan = 0x10003, // VkVendorId
1024 Codeplay = 0x10004, // VkVendorId
1025 Mesa = 0x10005, // VkVendorId
1026};
1027
1030{
1032
1053 RRT_Texture2D UE_DEPRECATED(5.7, "RRT_Texture2D is unused. Remove any remaining uses of it. There is a single RHI texture type which always uses RRT_Texture. RHI texture references use RRT_TextureReference."),
1054 RRT_Texture2DArray UE_DEPRECATED(5.7, "RRT_Texture2DArray is unused. Remove any remaining uses of it. There is a single RHI texture type which always uses RRT_Texture. RHI texture references use RRT_TextureReference."),
1055 RRT_Texture3D UE_DEPRECATED(5.7, "RRT_Texture3D is unused. Remove any remaining uses of it. There is a single RHI texture type which always uses RRT_Texture. RHI texture references use RRT_TextureReference."),
1056 RRT_TextureCube UE_DEPRECATED(5.7, "RRT_TextureCube is unused. Remove any remaining uses of it. There is a single RHI texture type which always uses RRT_Texture. RHI texture references use RRT_TextureReference."),
1075
1076 RRT_Num
1078
1081{
1082 Texture2D,
1084 Texture3D,
1087};
1088
1091{
1092 None = 0,
1093
1094 // Texture can be used as a render target
1095 RenderTargetable = 1ull << 0,
1096 // Texture can be used as a resolve target
1097 ResolveTargetable = 1ull << 1,
1098 // Texture can be used as a depth-stencil target.
1099 DepthStencilTargetable = 1ull << 2,
1100 // Texture can be used as a shader resource.
1101 ShaderResource = 1ull << 3,
1102 // Texture is encoded in sRGB gamma space
1103 SRGB = 1ull << 4,
1104 // Texture data is writable by the CPU
1105 CPUWritable = 1ull << 5,
1106 // Texture will be created with an un-tiled format
1107 NoTiling = 1ull << 6,
1108 // Texture will be used for video decode
1109 VideoDecode = 1ull << 7,
1110 // Texture expected to be updated by the CPU every frame, caches staging buffers on D3D12 to potentially improve performance and save memory
1111 Dynamic = 1ull << 8,
1112 // Texture will be used as a render pass attachment that will be read from
1113 InputAttachmentRead = 1ull << 9,
1115 Foveation = 1ull << 10,
1116 // Prefer 3D internal surface tiling mode for volume textures when possible
1117 Tiling3D = 1ull << 11,
1118 // This texture has no GPU or CPU backing. It only exists in tile memory on TBDR GPUs (i.e., mobile).
1119 Memoryless = 1ull << 12,
1120
1121 //UNUSED_BIT_13 = 1ull << 13,
1122
1123 // The texture can be partially allocated in fastvram
1124 FastVRAMPartialAlloc = 1ull << 14,
1125 // Do not create associated shader resource view, only applicable to D3D11 and D3D12
1126 DisableSRVCreation = 1ull << 15,
1127 // Do not allow Delta Color Compression (DCC) to be used with this texture
1128 DisableDCC = 1ull << 16,
1129 // UnorderedAccessView (DX11 only)
1130 // Warning: Causes additional synchronization between draw calls when using a render target allocated with this flag, use sparingly
1131 // See: GCNPerformanceTweets.pdf Tip 37
1132 UAV = 1ull << 17,
1133 // Render target texture that will be displayed on screen (back buffer)
1134 Presentable = 1ull << 18,
1135 // Texture data is accessible by the CPU
1136 CPUReadback = 1ull << 19,
1137 // Texture was processed offline (via a texture conversion process for the current platform)
1138 OfflineProcessed = 1ull << 20,
1139 // Texture needs to go in fast VRAM if available (HINT only)
1140 FastVRAM = 1ull << 21,
1141 // by default the texture is not showing up in the list - this is to reduce clutter, using the FULL option this can be ignored
1142 HideInVisualizeTexture = 1ull << 22,
1143 // Texture should be created in virtual memory, with no physical memory allocation made
1144 // You must make further calls to RHIVirtualTextureSetFirstMipInMemory to allocate physical memory
1145 // and RHIVirtualTextureSetFirstMipVisible to map the first mip visible to the GPU
1146 Virtual = 1ull << 23,
1147 // Creates a RenderTargetView for each array slice of the texture
1148 // Warning: if this was specified when the resource was created, you can't use SV_RenderTargetArrayIndex to route to other slices!
1149 TargetArraySlicesIndependently = 1ull << 24,
1150 // Texture that may be shared with DX9 or other devices
1151 Shared = 1ull << 25,
1152 // RenderTarget will not use full-texture fast clear functionality.
1153 NoFastClear = 1ull << 26,
1154 // Texture is a depth stencil resolve target
1155 DepthStencilResolveTarget = 1ull << 27,
1156 // Flag used to indicted this texture is a streamable 2D texture, and should be counted towards the texture streaming pool budget.
1157 Streamable = 1ull << 28,
1158 // Render target will not FinalizeFastClear; Caches and meta data will be flushed, but clearing will be skipped (avoids potentially trashing metadata)
1159 NoFastClearFinalize = 1ull << 29,
1161 Atomic64Compatible = 1ull << 30,
1162 // Workaround for 128^3 volume textures getting bloated 4x due to tiling mode on some platforms.
1163 ReduceMemoryWithTilingMode = 1ull << 31,
1165 AtomicCompatible = 1ull << 33,
1167 External = 1ull << 34,
1169 MultiGPUGraphIgnore = 1ull << 35,
1174 ReservedResource = 1ull << 37,
1176 ImmediateCommit = 1ull << 38,
1177
1180
1182 Invalid = 1ull << 40,
1183
1184 // Allow lossy framebuffer compression if supported by the GPU
1185 LossyCompression = 1ull << 41,
1186 LossyCompressionLowBitrate = 1ull << 42
1187};
1189
1190// Compatibility defines
1191#define TexCreate_None ETextureCreateFlags::None
1192#define TexCreate_RenderTargetable ETextureCreateFlags::RenderTargetable
1193#define TexCreate_ResolveTargetable ETextureCreateFlags::ResolveTargetable
1194#define TexCreate_DepthStencilTargetable ETextureCreateFlags::DepthStencilTargetable
1195#define TexCreate_ShaderResource ETextureCreateFlags::ShaderResource
1196#define TexCreate_SRGB ETextureCreateFlags::SRGB
1197#define TexCreate_CPUWritable ETextureCreateFlags::CPUWritable
1198#define TexCreate_NoTiling ETextureCreateFlags::NoTiling
1199#define TexCreate_VideoDecode ETextureCreateFlags::VideoDecode
1200#define TexCreate_Dynamic ETextureCreateFlags::Dynamic
1201#define TexCreate_InputAttachmentRead ETextureCreateFlags::InputAttachmentRead
1202#define TexCreate_Foveation ETextureCreateFlags::Foveation
1203#define TexCreate_3DTiling ETextureCreateFlags::Tiling3D
1204#define TexCreate_Memoryless ETextureCreateFlags::Memoryless
1205#define TexCreate_GenerateMipCapable ETextureCreateFlags::GenerateMipCapable
1206#define TexCreate_FastVRAMPartialAlloc ETextureCreateFlags::FastVRAMPartialAlloc
1207#define TexCreate_DisableSRVCreation ETextureCreateFlags::DisableSRVCreation
1208#define TexCreate_DisableDCC ETextureCreateFlags::DisableDCC
1209#define TexCreate_UAV ETextureCreateFlags::UAV
1210#define TexCreate_Presentable ETextureCreateFlags::Presentable
1211#define TexCreate_CPUReadback ETextureCreateFlags::CPUReadback
1212#define TexCreate_OfflineProcessed ETextureCreateFlags::OfflineProcessed
1213#define TexCreate_FastVRAM ETextureCreateFlags::FastVRAM
1214#define TexCreate_HideInVisualizeTexture ETextureCreateFlags::HideInVisualizeTexture
1215#define TexCreate_Virtual ETextureCreateFlags::Virtual
1216#define TexCreate_TargetArraySlicesIndependently ETextureCreateFlags::TargetArraySlicesIndependently
1217#define TexCreate_Shared ETextureCreateFlags::Shared
1218#define TexCreate_NoFastClear ETextureCreateFlags::NoFastClear
1219#define TexCreate_DepthStencilResolveTarget ETextureCreateFlags::DepthStencilResolveTarget
1220#define TexCreate_Streamable ETextureCreateFlags::Streamable
1221#define TexCreate_NoFastClearFinalize ETextureCreateFlags::NoFastClearFinalize
1222#define TexCreate_ReduceMemoryWithTilingMode ETextureCreateFlags::ReduceMemoryWithTilingMode
1223#define TexCreate_Transient ETextureCreateFlags::Transient
1224#define TexCreate_AtomicCompatible ETextureCreateFlags::AtomicCompatible
1225#define TexCreate_External ETextureCreateFlags::External
1226#define TexCreate_MultiGPUGraphIgnore ETextureCreateFlags::MultiGPUGraphIgnore
1227#define TexCreate_ReservedResource ETextureCreateFlags::ReservedResource
1228#define TexCreate_ImmediateCommit ETextureCreateFlags::ImmediateCommit
1229#define TexCreate_Invalid ETextureCreateFlags::Invalid
1230#define TexCreate_LossyCompression ETextureCreateFlags::LossyCompression
1231#define TexCreate_LossyCompressionLowBitrate ETextureCreateFlags::LossyCompressionLowBitrate
1232
1238
1248
1253{
1254 // Untouched contents of the render target are undefined. Any existing content is not preserved.
1255 ENoAction,
1256
1257 // Existing contents are preserved.
1258 ELoad,
1259
1260 // The render target is cleared to the fast clear value specified on the resource.
1261 EClear,
1262
1263 Num,
1264 NumBits = 2,
1265};
1266static_assert((uint32)ERenderTargetLoadAction::Num <= (1 << (uint32)ERenderTargetLoadAction::NumBits), "ERenderTargetLoadAction::Num will not fit on ERenderTargetLoadAction::NumBits");
1267
1272{
1273 // Contents of the render target emitted during the pass are not stored back to memory.
1274 ENoAction,
1275
1276 // Contents of the render target emitted during the pass are stored back to memory.
1277 EStore,
1278
1279 // Contents of the render target emitted during the pass are resolved using a box filter and stored back to memory.
1281
1282 Num,
1283 NumBits = 2,
1284};
1285static_assert((uint32)ERenderTargetStoreAction::Num <= (1 << (uint32)ERenderTargetStoreAction::NumBits), "ERenderTargetStoreAction::Num will not fit on ERenderTargetStoreAction::NumBits");
1286
1291{
1292 // These will all store out color and depth
1293 EExistingColorAndDepth, // Color = Existing, Depth = Existing
1294 EUninitializedColorAndDepth, // Color = ????, Depth = ????
1295 EUninitializedColorExistingDepth, // Color = ????, Depth = Existing
1296 EUninitializedColorClearDepth, // Color = ????, Depth = Default
1297 EClearColorExistingDepth, // Clear Color = whatever was bound to the rendertarget at creation time. Depth = Existing
1298 EClearColorAndDepth, // Clear color and depth to bound clear values.
1299 EExistingContents_NoDepthStore, // Load existing contents, but don't store depth out. depth can be written.
1300 EExistingColorAndClearDepth, // Color = Existing, Depth = clear value
1301 EExistingColorAndDepthAndClearStencil, // Color = Existing, Depth = Existing, Stencil = clear
1302
1303 // If you add an item here, make sure to add it to DecodeRenderTargetMode() as well!
1304};
1305
1307{
1308 Depth,
1309 Stencil,
1311};
1312
1317{
1318 ELeast_0, //Least amount of GPU allocated to AsyncCompute that still gets 'some' done.
1319 EGfxHeavy_1, //Gfx gets most of the GPU.
1320 EBalanced_2, //Async compute and Gfx share GPU equally.
1321 EComputeHeavy_3, //Async compute can use most of the GPU
1322 EAll_4, //Async compute can use the entire GPU.
1323};
1324
1331{
1332 Default, // Use default behavior chosen by the current RHI
1333 Balanced, // Balance GPU resources to allow overlapped graphics and compute shader execution
1334 ComputeHeavy, // Give more of the GPU resources to run synchronous compute workloads
1335};
1336
1338{
1339 Standard,
1340 Sampler,
1343 Count,
1345};
1346
1348{
1349 BufferSRV,
1350 BufferUAV,
1351
1354
1355 TextureSRV,
1356 TextureUAV,
1357
1358 CBV,
1359 Sampler,
1360
1362
1363 Invalid
1364};
1365
1367{
1368 None = 0,
1369
1370 BufferSRV = (1 << static_cast<int32>(ERHIDescriptorType::BufferSRV)),
1371 BufferUAV = (1 << static_cast<int32>(ERHIDescriptorType::BufferUAV)),
1372
1375
1376 TextureSRV = (1 << static_cast<int32>(ERHIDescriptorType::TextureSRV)),
1377 TextureUAV = (1 << static_cast<int32>(ERHIDescriptorType::TextureUAV)),
1378
1379 CBV = (1 << static_cast<int32>(ERHIDescriptorType::CBV)),
1380 Sampler = (1 << static_cast<int32>(ERHIDescriptorType::Sampler)),
1381
1383
1386
1388};
1390
1392{
1394 {
1396 }
1397 return static_cast<ERHIDescriptorTypeMask>(1 << static_cast<int32>(InType));
1398}
1399
1401{
1403
1409
1411 {
1412 return Index;
1413 }
1414
1416 {
1417 return Type;
1418 }
1419
1420 bool IsValid() const
1421 {
1422 return Index != MAX_uint32 && Type != ERHIDescriptorType::Invalid;
1423 }
1424
1425private:
1428};
1429
1430// Configuration levels for Bindless. Each value should include more shaders than the previous.
1432{
1433 Disabled,
1434
1435 // Only RayTracing shaders
1436 RayTracing,
1437
1438 // RayTracing + Materials + shader types that have opted-in for bindless
1439 Minimal,
1440
1441 // All shaders
1442 All
1443};
1444
1446{
1447 return Configuration == ERHIBindlessConfiguration::Disabled;
1448}
1449
1451{
1452 return Configuration == ERHIBindlessConfiguration::RayTracing;
1453}
1454
1456{
1457 return Configuration >= ERHIBindlessConfiguration::RayTracing;
1458}
1459
1461{
1462 return Configuration >= ERHIBindlessConfiguration::Minimal;
1463}
1464
1466{
1467 return Configuration == ERHIBindlessConfiguration::All;
1468}
1469
1471{
1472 EUnknown = 0,
1473
1474 EColorSpace_Rec709 = 1, // Color Space Uses Rec 709 Primaries
1475 EColorSpace_Rec2020 = 2, // Color Space Uses Rec 2020 Primaries
1476 EColorSpace_DCIP3 = 3, // Color Space Uses DCI-P3 Primaries
1477 EEColorSpace_MASK = 0xf,
1478
1479 EEOTF_Linear = 1 << 4, // Transfer Function Uses Linear Encoding
1480 EEOTF_sRGB = 2 << 4, // Transfer Function Uses sRGB Encoding
1481 EEOTF_PQ = 3 << 4, // Transfer Function Uses PQ Encoding
1482 EEOTF_MASK = 0xf << 4,
1483
1486
1489
1492};
1493
1495{
1496 None = 0,
1497
1498 // Disables fencing between pipelines during the transition.
1499 NoFence = 1 << 0,
1500
1501 // Indicates the transition will have no useful work between the Begin/End calls,
1502 // so should use a partial flush rather than a fence as this is more optimal.
1503 NoSplit = 1 << 1,
1504
1505 // Indicates that the transition is allowed to happen during a RenderPass
1506 AllowDuringRenderPass = 1 << 2,
1507
1508 // This is an advanced mode that allows issuing a transition using a single pipeline as the previous pipelines in a transition
1509 // for a resource that was previously transitioned to ERHIPipeline::All. It assumes that a manual fence was issued to synchronize
1510 // the prior async compute work. It also assumes that tracked access for a resource (using SetTrackedAccess) is up to date.
1511 AllowDecayPipelines = 1 << 3
1512};
1513
1515
1517{
1518 None = 0,
1519
1520 MaintainCompression = 1 << 0, // Specifies that the transition should not decompress the resource, allowing us to read a compressed resource directly in its compressed state.
1521 IgnoreAfterState = 1 << 1, // The transition will be patched for Unknown if needed but the After State will be ignored by the tracker
1522
1524 Mask = (Last << 1) - 1
1525};
1527
1529{
1530 None = 0,
1531 Type_Hang = 1 << 0,
1532 Type_PageFault = 1 << 1,
1533 Type_PlatformBreak = 1 << 2,
1534 Type_Assert = 1 << 3,
1535 Type_CmdListCorruption = 1 << 4,
1536
1537 Queue_Direct = 1 << 5,
1538 Queue_Compute = 1 << 6,
1539};
1541
1544{
1545 return
1546 BaseType == UBMT_RDG_TEXTURE ||
1547 BaseType == UBMT_RDG_TEXTURE_SRV ||
1548 BaseType == UBMT_RDG_TEXTURE_NON_PIXEL_SRV ||
1549 BaseType == UBMT_RDG_TEXTURE_UAV ||
1550 BaseType == UBMT_RDG_TEXTURE_ACCESS ||
1552}
1553
1556{
1557 return
1558 BaseType == UBMT_RDG_BUFFER_SRV ||
1559 BaseType == UBMT_RDG_BUFFER_UAV ||
1560 BaseType == UBMT_RDG_BUFFER_ACCESS ||
1561 BaseType == UBMT_RDG_BUFFER_ACCESS_ARRAY;
1562}
1563
1566{
1567 return
1568 BaseType == UBMT_RDG_TEXTURE_ACCESS ||
1569 BaseType == UBMT_RDG_TEXTURE_ACCESS_ARRAY ||
1570 BaseType == UBMT_RDG_BUFFER_ACCESS ||
1571 BaseType == UBMT_RDG_BUFFER_ACCESS_ARRAY;
1572}
1573
1579
1581{
1582 return
1583 BaseType == UBMT_TEXTURE ||
1584 BaseType == UBMT_SRV ||
1585 BaseType == UBMT_SAMPLER ||
1586 BaseType == UBMT_RESOURCE_COLLECTION;
1587}
1588
1590{
1591 return
1593 BaseType == UBMT_UAV;
1594}
1595
1598{
1599 return
1600 // RHI resource referenced in shader parameter structures.
1602
1603 // RHI is able to access RHI resources from RDG.
1605
1606 // Render graph uses FRHIUniformBufferLayout to walk pass' parameters.
1607 BaseType == UBMT_REFERENCED_STRUCT ||
1609}
1610
1613{
1614 return
1615 // Render targets bindings slots needs to be in FRHIUniformBufferLayout for render graph, but the RHI does not actually need to know about it.
1617
1618 // Custom access states are used by the render graph.
1619 IsRDGResourceAccessType(BaseType) ||
1620
1621 // #yuriy_todo: RHI is able to dereference uniform buffer in root shader parameter structures
1622 BaseType == UBMT_REFERENCED_STRUCT ||
1623 BaseType == UBMT_RDG_UNIFORM_BUFFER;
1624}
1625
1627{
1628 switch ((EGpuVendorId)VendorId)
1629 {
1632
1633 case EGpuVendorId::Amd:
1636 case EGpuVendorId::Mesa:
1639 case EGpuVendorId::Arm:
1648 return (EGpuVendorId)VendorId;
1649
1651 default:
1652 return EGpuVendorId::Unknown;
1653 }
1654}
1655
1657{
1658 switch (Frequency)
1659 {
1660 case SF_Mesh:
1661 case SF_Amplification:
1662 return true;
1663 case SF_Vertex:
1664 case SF_Pixel:
1665 case SF_Geometry:
1666 case SF_Compute:
1667 case SF_RayGen:
1668 case SF_RayMiss:
1669 case SF_RayHitGroup:
1670 case SF_RayCallable:
1671 case SF_WorkGraphRoot:
1673 case SF_NumFrequencies:
1674 default:
1675 return false;
1676 }
1677}
1678
1680{
1681 switch (Frequency)
1682 {
1683 case SF_RayGen:
1684 case SF_RayMiss:
1685 case SF_RayHitGroup:
1686 case SF_RayCallable:
1687 return true;
1688 case SF_Vertex:
1689 case SF_Mesh:
1690 case SF_Amplification:
1691 case SF_Pixel:
1692 case SF_Geometry:
1693 case SF_Compute:
1694 case SF_WorkGraphRoot:
1696 case SF_NumFrequencies:
1697 default:
1698 return false;
1699 }
1700}
1701
1703{
1704 switch (Frequency)
1705 {
1706 case SF_WorkGraphRoot:
1708 return true;
1709 case SF_Vertex:
1710 case SF_Mesh:
1711 case SF_Amplification:
1712 case SF_Pixel:
1713 case SF_Geometry:
1714 case SF_Compute:
1715 case SF_RayGen:
1716 case SF_RayMiss:
1717 case SF_RayHitGroup:
1718 case SF_RayCallable:
1719 case SF_NumFrequencies:
1720 default:
1721 return false;
1722 }
1723}
1724
1725UE_DEPRECATED(5.7, "GetRHIResourceType(ETextureDimension Dimension) is deprecated. There is a single RHI texture type which always uses RRT_Texture now, which makes this function pointless. Remove any remaining uses of this function.")
1730
1731#if PLATFORM_SUPPORTS_GEOMETRY_SHADERS
1732 #define GEOMETRY_SHADER(GeometryShader) (GeometryShader)
1733#else
1734 #define GEOMETRY_SHADER(GeometryShader) nullptr
1735#endif
1736
1744
1750
1756
#define check(expr)
Definition AssertionMacros.h:314
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define UE_STATIC_DEPRECATE(Version, bExpression, Message)
Definition CoreMiscDefines.h:420
#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::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
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define NAME_NO_NUMBER_INTERNAL
Definition NameTypes.h:157
#define MAX_uint32
Definition NumericLimits.h:21
#define MAX_uint8
Definition NumericLimits.h:19
ERHIUniformBufferFlags
Definition RHIDefinitions.h:704
ERangeCompressionMode
Definition RHIDefinitions.h:797
@ RCM_MinMaxNorm
Definition RHIDefinitions.h:803
@ RCM_UNorm
Definition RHIDefinitions.h:799
@ RCM_MinMax
Definition RHIDefinitions.h:805
@ RCM_SNorm
Definition RHIDefinitions.h:801
bool IsBindlessFullyEnabled(ERHIBindlessConfiguration Configuration)
Definition RHIDefinitions.h:1465
EVertexElementType
Definition RHIDefinitions.h:496
@ VET_Short4
Definition RHIDefinitions.h:507
@ VET_Half4
Definition RHIDefinitions.h:510
@ VET_UShort2N
Definition RHIDefinitions.h:514
@ VET_Short2
Definition RHIDefinitions.h:506
@ VET_Float1
Definition RHIDefinitions.h:498
@ VET_UByte4N
Definition RHIDefinitions.h:504
@ VET_Color
Definition RHIDefinitions.h:505
@ VET_Float3
Definition RHIDefinitions.h:500
@ VET_UShort4N
Definition RHIDefinitions.h:515
@ VET_Half2
Definition RHIDefinitions.h:509
@ VET_UShort2
Definition RHIDefinitions.h:512
@ VET_Float4
Definition RHIDefinitions.h:501
@ VET_NumBits
Definition RHIDefinitions.h:520
@ VET_UByte4
Definition RHIDefinitions.h:503
@ VET_PackedNormal
Definition RHIDefinitions.h:502
@ VET_MAX
Definition RHIDefinitions.h:518
@ VET_Short2N
Definition RHIDefinitions.h:508
@ VET_UInt
Definition RHIDefinitions.h:517
@ VET_Short4N
Definition RHIDefinitions.h:511
@ VET_UShort4
Definition RHIDefinitions.h:513
@ VET_URGB10A2N
Definition RHIDefinitions.h:516
@ VET_None
Definition RHIDefinitions.h:497
@ VET_Float2
Definition RHIDefinitions.h:499
bool IsGeometryPipelineShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1656
EShaderFrequency
Definition RHIDefinitions.h:202
@ SF_NumGraphicsFrequencies
Definition RHIDefinitions.h:219
@ SF_Compute
Definition RHIDefinitions.h:208
@ SF_NumFrequencies
Definition RHIDefinitions.h:216
@ SF_Amplification
Definition RHIDefinitions.h:205
@ SF_Vertex
Definition RHIDefinitions.h:203
@ SF_NumBits
Definition RHIDefinitions.h:224
@ SF_Mesh
Definition RHIDefinitions.h:204
@ SF_Geometry
Definition RHIDefinitions.h:207
@ SF_RayGen
Definition RHIDefinitions.h:209
@ SF_RayCallable
Definition RHIDefinitions.h:212
@ SF_RayMiss
Definition RHIDefinitions.h:210
@ SF_RayHitGroup
Definition RHIDefinitions.h:211
@ SF_WorkGraphRoot
Definition RHIDefinitions.h:213
@ SF_WorkGraphComputeNode
Definition RHIDefinitions.h:214
@ SF_Pixel
Definition RHIDefinitions.h:206
@ SF_NumStandardFrequencies
Definition RHIDefinitions.h:222
@ MAX_UNIFORM_BUFFER_STATIC_SLOTS
Definition RHIDefinitions.h:727
ESamplerAddressMode
Definition RHIDefinitions.h:339
@ ESamplerAddressMode_NumBits
Definition RHIDefinitions.h:347
@ AM_Mirror
Definition RHIDefinitions.h:342
@ AM_Border
Definition RHIDefinitions.h:344
@ AM_Wrap
Definition RHIDefinitions.h:340
@ ESamplerAddressMode_Num
Definition RHIDefinitions.h:346
@ AM_Clamp
Definition RHIDefinitions.h:341
ERHIDescriptorTypeMask
Definition RHIDefinitions.h:1367
EResourceTransitionFlags
Definition RHIDefinitions.h:1517
ERHIDescriptorType
Definition RHIDefinitions.h:1348
@ ShaderArrayElementAlignBytes
Definition RHIDefinitions.h:282
EGpuVendorId RHIConvertToGpuVendorId(uint32 VendorId)
Definition RHIDefinitions.h:1626
bool IsRDGResourceAccessType(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1565
ERHIResourceType
Definition RHIDefinitions.h:1030
@ RRT_SamplerState
Definition RHIDefinitions.h:1033
@ RRT_Num
Definition RHIDefinitions.h:1076
@ RRT_RayTracingAccelerationStructure
Definition RHIDefinitions.h:1065
@ RRT_RayTracingShader
Definition RHIDefinitions.h:1043
@ RRT_AmplificationShader
Definition RHIDefinitions.h:1040
@ RRT_PixelShader
Definition RHIDefinitions.h:1041
@ RRT_RenderQuery
Definition RHIDefinitions.h:1060
@ RRT_WorkGraphShader
Definition RHIDefinitions.h:1071
@ RRT_DepthStencilState
Definition RHIDefinitions.h:1035
@ RRT_ShaderBundle
Definition RHIDefinitions.h:1070
@ RRT_ShaderLibrary
Definition RHIDefinitions.h:1069
@ RRT_TextureReference
Definition RHIDefinitions.h:1057
@ RRT_CustomPresent
Definition RHIDefinitions.h:1068
@ RRT_UniformBufferLayout
Definition RHIDefinitions.h:1049
@ RRT_RenderQueryPool
Definition RHIDefinitions.h:1061
@ UE_DEPRECATED
Definition RHIDefinitions.h:295
@ RRT_BlendState
Definition RHIDefinitions.h:1036
@ RRT_VertexShader
Definition RHIDefinitions.h:1038
@ RRT_RayTracingPipelineState
Definition RHIDefinitions.h:1047
@ RRT_BoundShaderState
Definition RHIDefinitions.h:1048
@ RRT_UniformBuffer
Definition RHIDefinitions.h:1050
@ RRT_VertexDeclaration
Definition RHIDefinitions.h:1037
@ RRT_StagingBuffer
Definition RHIDefinitions.h:1067
@ RRT_RasterizerState
Definition RHIDefinitions.h:1034
@ RRT_Buffer
Definition RHIDefinitions.h:1051
@ RRT_ComputePipelineState
Definition RHIDefinitions.h:1046
@ RRT_GeometryShader
Definition RHIDefinitions.h:1042
@ RRT_ResourceCollection
Definition RHIDefinitions.h:1074
@ RRT_Viewport
Definition RHIDefinitions.h:1062
@ RRT_StreamSourceSlot
Definition RHIDefinitions.h:1073
@ RRT_Texture
Definition RHIDefinitions.h:1052
@ RRT_UnorderedAccessView
Definition RHIDefinitions.h:1063
@ RRT_ShaderResourceView
Definition RHIDefinitions.h:1064
@ RRT_MeshShader
Definition RHIDefinitions.h:1039
@ RRT_WorkGraphPipelineState
Definition RHIDefinitions.h:1072
@ RRT_ComputeShader
Definition RHIDefinitions.h:1044
@ RRT_GPUFence
Definition RHIDefinitions.h:1059
@ RRT_None
Definition RHIDefinitions.h:1031
@ RRT_RayTracingShaderBindingTable
Definition RHIDefinitions.h:1066
@ RRT_GraphicsPipelineState
Definition RHIDefinitions.h:1045
@ RRT_TimestampCalibrationQuery
Definition RHIDefinitions.h:1058
ERequestedGPUCrash
Definition RHIDefinitions.h:1529
EBlendOperation
Definition RHIDefinitions.h:459
@ EBlendOperation_Num
Definition RHIDefinitions.h:466
@ EBlendOperation_NumBits
Definition RHIDefinitions.h:467
@ BO_Min
Definition RHIDefinitions.h:462
@ BO_Add
Definition RHIDefinitions.h:460
@ BO_Subtract
Definition RHIDefinitions.h:461
@ BO_ReverseSubtract
Definition RHIDefinitions.h:464
@ BO_Max
Definition RHIDefinitions.h:463
ESimpleRenderTargetMode
Definition RHIDefinitions.h:1291
@ MaxSimultaneousRenderTargets_NumBits
Definition RHIDefinitions.h:288
@ MaxSimultaneousRenderTargets
Definition RHIDefinitions.h:287
EBufferUsageFlags
Definition RHIDefinitions.h:892
EUniformBufferUsage
Definition RHIDefinitions.h:536
@ UniformBuffer_MultiFrame
Definition RHIDefinitions.h:542
@ UniformBuffer_SingleDraw
Definition RHIDefinitions.h:538
@ UniformBuffer_SingleFrame
Definition RHIDefinitions.h:540
EVRSImageDataType
Definition RHIDefinitions.h:882
@ VRSImage_Fractional
Definition RHIDefinitions.h:885
@ VRSImage_Palette
Definition RHIDefinitions.h:884
@ VRSImage_NotSupported
Definition RHIDefinitions.h:883
@ MaxVertexElementCount
Definition RHIDefinitions.h:276
@ MaxVertexElementCount_NumBits
Definition RHIDefinitions.h:277
ETextureDimension
Definition RHIDefinitions.h:1081
EStencilOp
Definition RHIDefinitions.h:443
@ SO_Invert
Definition RHIDefinitions.h:449
@ SO_Zero
Definition RHIDefinitions.h:445
@ EStencilOp_NumBits
Definition RHIDefinitions.h:454
@ SO_Replace
Definition RHIDefinitions.h:446
@ EStencilOp_Num
Definition RHIDefinitions.h:453
@ SO_Increment
Definition RHIDefinitions.h:450
@ SO_Keep
Definition RHIDefinitions.h:444
@ SO_SaturatedDecrement
Definition RHIDefinitions.h:448
@ SO_SaturatedIncrement
Definition RHIDefinitions.h:447
@ SO_Decrement
Definition RHIDefinitions.h:451
bool IsBindlessEnabledForRayTracing(ERHIBindlessConfiguration Configuration)
Definition RHIDefinitions.h:1455
bool IsShaderParameterTypeForUniformBufferLayout(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1597
ERasterizerCullMode
Definition RHIDefinitions.h:369
@ ERasterizerCullMode_Num
Definition RHIDefinitions.h:374
@ ERasterizerCullMode_NumBits
Definition RHIDefinitions.h:375
@ CM_CCW
Definition RHIDefinitions.h:372
@ CM_CW
Definition RHIDefinitions.h:371
@ CM_None
Definition RHIDefinitions.h:370
ERHITransitionCreateFlags
Definition RHIDefinitions.h:1495
ECubeFace
Definition RHIDefinitions.h:525
@ CubeFace_NegX
Definition RHIDefinitions.h:527
@ CubeFace_MAX
Definition RHIDefinitions.h:532
@ CubeFace_PosX
Definition RHIDefinitions.h:526
@ CubeFace_NegY
Definition RHIDefinitions.h:529
@ CubeFace_NegZ
Definition RHIDefinitions.h:531
@ CubeFace_PosZ
Definition RHIDefinitions.h:530
@ CubeFace_PosY
Definition RHIDefinitions.h:528
EStencilMask
Definition RHIDefinitions.h:428
@ SM_255
Definition RHIDefinitions.h:430
@ SM_32
Definition RHIDefinitions.h:436
@ SM_4
Definition RHIDefinitions.h:433
@ SM_64
Definition RHIDefinitions.h:437
@ SM_1
Definition RHIDefinitions.h:431
@ SM_Default
Definition RHIDefinitions.h:429
@ SM_8
Definition RHIDefinitions.h:434
@ SM_128
Definition RHIDefinitions.h:438
@ SM_2
Definition RHIDefinitions.h:432
@ SM_16
Definition RHIDefinitions.h:435
@ SM_Count
Definition RHIDefinitions.h:439
EResourceLockMode
Definition RHIDefinitions.h:785
@ RLM_WriteOnly
Definition RHIDefinitions.h:787
@ RLM_ReadOnly
Definition RHIDefinitions.h:786
@ RLM_Num
Definition RHIDefinitions.h:789
@ RLM_WriteOnly_NoOverwrite
Definition RHIDefinitions.h:788
uint8 FUniformBufferStaticSlot
Definition RHIDefinitions.h:722
ESyncComputeBudget
Definition RHIDefinitions.h:1331
bool IsShaderParameterTypeRHIResource(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1589
EUniformBufferBaseType
Definition RHIDefinitions.h:634
@ UBMT_SRV
Definition RHIDefinitions.h:648
@ UBMT_UAV
Definition RHIDefinitions.h:649
@ UBMT_BOOL
Definition RHIDefinitions.h:639
@ UBMT_FLOAT32
Definition RHIDefinitions.h:644
@ EUniformBufferBaseType_NumBits
Definition RHIDefinitions.h:680
@ UBMT_RDG_BUFFER_UAV
Definition RHIDefinitions.h:662
@ UBMT_REFERENCED_STRUCT
Definition RHIDefinitions.h:672
@ UBMT_RENDER_TARGET_BINDING_SLOTS
Definition RHIDefinitions.h:675
@ UBMT_RDG_UNIFORM_BUFFER
Definition RHIDefinitions.h:663
@ UBMT_RDG_TEXTURE_NON_PIXEL_SRV
Definition RHIDefinitions.h:657
@ UBMT_RDG_BUFFER_ACCESS
Definition RHIDefinitions.h:659
@ UBMT_RESOURCE_COLLECTION
Definition RHIDefinitions.h:677
@ UBMT_NESTED_STRUCT
Definition RHIDefinitions.h:666
@ UBMT_UINT32
Definition RHIDefinitions.h:643
@ UBMT_RDG_TEXTURE
Definition RHIDefinitions.h:653
@ UBMT_RDG_BUFFER_ACCESS_ARRAY
Definition RHIDefinitions.h:660
@ UBMT_RDG_TEXTURE_SRV
Definition RHIDefinitions.h:656
@ EUniformBufferBaseType_Num
Definition RHIDefinitions.h:679
@ UBMT_RDG_BUFFER_SRV
Definition RHIDefinitions.h:661
@ UBMT_INVALID
Definition RHIDefinitions.h:635
@ UBMT_INT32
Definition RHIDefinitions.h:642
@ UBMT_INCLUDED_STRUCT
Definition RHIDefinitions.h:669
@ UBMT_RDG_TEXTURE_ACCESS_ARRAY
Definition RHIDefinitions.h:655
@ UBMT_RDG_TEXTURE_ACCESS
Definition RHIDefinitions.h:654
@ UBMT_TEXTURE
Definition RHIDefinitions.h:647
@ UBMT_RDG_TEXTURE_UAV
Definition RHIDefinitions.h:658
@ UBMT_SAMPLER
Definition RHIDefinitions.h:650
ECompareFunction
Definition RHIDefinitions.h:406
@ CF_DepthNear
Definition RHIDefinitions.h:421
@ CF_Never
Definition RHIDefinitions.h:413
@ CF_LessEqual
Definition RHIDefinitions.h:408
@ CF_Less
Definition RHIDefinitions.h:407
@ CF_NotEqual
Definition RHIDefinitions.h:412
@ ECompareFunction_Num
Definition RHIDefinitions.h:416
@ CF_Equal
Definition RHIDefinitions.h:411
@ CF_Greater
Definition RHIDefinitions.h:409
@ CF_DepthFartherOrEqual
Definition RHIDefinitions.h:422
@ CF_DepthFarther
Definition RHIDefinitions.h:423
@ CF_DepthNearOrEqual
Definition RHIDefinitions.h:420
@ ECompareFunction_NumBits
Definition RHIDefinitions.h:417
@ CF_Always
Definition RHIDefinitions.h:414
@ CF_GreaterEqual
Definition RHIDefinitions.h:410
EClearDepthStencil
Definition RHIDefinitions.h:1307
bool IsUniformBufferStaticSlotValid(const FUniformBufferStaticSlot Slot)
Definition RHIDefinitions.h:731
EVRSRateCombiner
Definition RHIDefinitions.h:873
@ VRSRB_Override
Definition RHIDefinitions.h:875
@ VRSRB_Min
Definition RHIDefinitions.h:876
@ VRSRB_Max
Definition RHIDefinitions.h:877
@ VRSRB_Passthrough
Definition RHIDefinitions.h:874
@ VRSRB_Sum
Definition RHIDefinitions.h:878
EUniformBufferBindingFlags
Definition RHIDefinitions.h:686
bool IsRayTracingShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1679
ERasterizerDepthClipMode
Definition RHIDefinitions.h:380
ERHIBindlessConfiguration
Definition RHIDefinitions.h:1432
ERHIZBuffer
Definition RHIDefinitions.h:299
ERHIDescriptorHeapType
Definition RHIDefinitions.h:1338
ERHIResourceType GetRHIResourceType(ETextureDimension)
Definition RHIDefinitions.h:1726
bool IsBindlessEnabledForAnyGraphics(ERHIBindlessConfiguration Configuration)
Definition RHIDefinitions.h:1460
constexpr ERHIDescriptorTypeMask RHIDescriptorTypeMaskFromType(ERHIDescriptorType InType)
Definition RHIDefinitions.h:1391
bool IsWorkGraphShaderFrequency(EShaderFrequency Frequency)
Definition RHIDefinitions.h:1702
ESamplerFilter
Definition RHIDefinitions.h:326
@ SF_AnisotropicPoint
Definition RHIDefinitions.h:330
@ ESamplerFilter_Num
Definition RHIDefinitions.h:333
@ SF_Bilinear
Definition RHIDefinitions.h:328
@ SF_AnisotropicLinear
Definition RHIDefinitions.h:331
@ SF_Point
Definition RHIDefinitions.h:327
@ SF_Trilinear
Definition RHIDefinitions.h:329
@ ESamplerFilter_NumBits
Definition RHIDefinitions.h:334
EVRSAxisShadingRate
Definition RHIDefinitions.h:853
@ VRSASR_1X
Definition RHIDefinitions.h:854
@ VRSASR_2X
Definition RHIDefinitions.h:855
@ VRSASR_4X
Definition RHIDefinitions.h:856
EShaderCodeResourceBindingType
Definition RHIDefinitions.h:553
bool IsBindlessDisabled(ERHIBindlessConfiguration Configuration)
Definition RHIDefinitions.h:1445
bool IsValidGraphicsFrequency(EShaderFrequency InShaderFrequency)
Definition RHIDefinitions.h:228
bool IsBindlessEnabledForOnlyRayTracing(ERHIBindlessConfiguration Configuration)
Definition RHIDefinitions.h:1450
EPrimitiveTopologyType
Definition RHIDefinitions.h:809
ESamplerCompareFunction
Definition RHIDefinitions.h:352
@ SCF_Never
Definition RHIDefinitions.h:353
@ SCF_Less
Definition RHIDefinitions.h:354
EAsyncComputeBudget
Definition RHIDefinitions.h:1317
ETextureReallocationStatus
Definition RHIDefinitions.h:1243
@ TexRealloc_Failed
Definition RHIDefinitions.h:1245
@ TexRealloc_InProgress
Definition RHIDefinitions.h:1246
@ TexRealloc_Succeeded
Definition RHIDefinitions.h:1244
ERenderTargetStoreAction
Definition RHIDefinitions.h:1272
bool IsShaderParameterTypeIgnoredByRHI(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1612
ERHIStaticShaderBindingLayoutSupport
Definition RHIDefinitions.h:193
EUniformBufferValidation
Definition RHIDefinitions.h:546
ERHIInterfaceType
Definition RHIDefinitions.h:157
ETextureCreateFlags
Definition RHIDefinitions.h:1091
ERenderQueryType
Definition RHIDefinitions.h:258
@ RQT_Undefined
Definition RHIDefinitions.h:260
@ RQT_AbsoluteTime
Definition RHIDefinitions.h:264
@ RQT_Occlusion
Definition RHIDefinitions.h:262
bool IsRDGTextureReferenceShaderParameterType(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1543
EBlendFactor
Definition RHIDefinitions.h:472
@ BF_DestColor
Definition RHIDefinitions.h:481
@ BF_SourceAlpha
Definition RHIDefinitions.h:477
@ BF_ConstantBlendFactor
Definition RHIDefinitions.h:483
@ BF_InverseSource1Color
Definition RHIDefinitions.h:486
@ BF_One
Definition RHIDefinitions.h:474
@ EBlendFactor_NumBits
Definition RHIDefinitions.h:491
@ BF_Zero
Definition RHIDefinitions.h:473
@ BF_InverseConstantBlendFactor
Definition RHIDefinitions.h:484
@ BF_InverseDestColor
Definition RHIDefinitions.h:482
@ EBlendFactor_Num
Definition RHIDefinitions.h:490
@ BF_Source1Color
Definition RHIDefinitions.h:485
@ BF_InverseSourceColor
Definition RHIDefinitions.h:476
@ BF_InverseSourceAlpha
Definition RHIDefinitions.h:478
@ BF_InverseSource1Alpha
Definition RHIDefinitions.h:488
@ BF_InverseDestAlpha
Definition RHIDefinitions.h:480
@ BF_DestAlpha
Definition RHIDefinitions.h:479
@ BF_Source1Alpha
Definition RHIDefinitions.h:487
@ BF_SourceColor
Definition RHIDefinitions.h:475
ERenderTargetLoadAction
Definition RHIDefinitions.h:1253
@ MAX_TEXTURE_MIP_COUNT
Definition RHIDefinitions.h:268
bool IsComputeShaderFrequency(EShaderFrequency ShaderFrequency)
Definition RHIDefinitions.h:243
EColorWriteMask
Definition RHIDefinitions.h:390
@ CW_RGBA
Definition RHIDefinitions.h:398
@ CW_RGB
Definition RHIDefinitions.h:397
@ CW_NONE
Definition RHIDefinitions.h:396
@ CW_RG
Definition RHIDefinitions.h:399
@ CW_BA
Definition RHIDefinitions.h:400
@ EColorWriteMask_NumBits
Definition RHIDefinitions.h:402
@ CW_ALPHA
Definition RHIDefinitions.h:394
@ CW_GREEN
Definition RHIDefinitions.h:392
@ CW_BLUE
Definition RHIDefinitions.h:393
@ CW_RED
Definition RHIDefinitions.h:391
EAsyncComputePriority
Definition RHIDefinitions.h:1234
@ AsyncComputePriority_High
Definition RHIDefinitions.h:1236
@ AsyncComputePriority_Default
Definition RHIDefinitions.h:1235
@ MAX_MESH_LOD_COUNT
Definition RHIDefinitions.h:271
bool IsRDGBufferReferenceShaderParameterType(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1555
EColorSpaceAndEOTF
Definition RHIDefinitions.h:1471
EGpuVendorId
Definition RHIDefinitions.h:1006
#define SHADER_PARAMETER_POINTER_ALIGNMENT
Definition RHIDefinitions.h:35
bool IsResourceBindingTypeSRV(EShaderCodeResourceBindingType Type)
Definition RHIDefinitions.h:595
ERasterizerFillMode
Definition RHIDefinitions.h:358
@ FM_Point
Definition RHIDefinitions.h:359
@ ERasterizerFillMode_Num
Definition RHIDefinitions.h:363
@ FM_Solid
Definition RHIDefinitions.h:361
@ FM_Wireframe
Definition RHIDefinitions.h:360
@ ERasterizerFillMode_NumBits
Definition RHIDefinitions.h:364
bool IsRDGResourceReferenceShaderParameterType(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1575
bool IsShaderParameterTypeReadOnlyRHIResource(EUniformBufferBaseType BaseType)
Definition RHIDefinitions.h:1580
EPrimitiveType
Definition RHIDefinitions.h:822
@ PT_RectList
Definition RHIDefinitions.h:844
@ PT_NumBits
Definition RHIDefinitions.h:847
@ PT_PointList
Definition RHIDefinitions.h:837
@ PT_LineList
Definition RHIDefinitions.h:830
@ PT_TriangleList
Definition RHIDefinitions.h:824
@ PT_Num
Definition RHIDefinitions.h:846
@ PT_QuadList
Definition RHIDefinitions.h:834
@ PT_TriangleStrip
Definition RHIDefinitions.h:827
EVRSShadingRate
Definition RHIDefinitions.h:860
@ VRSSR_2x1
Definition RHIDefinitions.h:863
@ VRSSR_Last
Definition RHIDefinitions.h:869
@ VRSSR_1x2
Definition RHIDefinitions.h:862
@ VRSSR_2x4
Definition RHIDefinitions.h:865
@ VRSSR_1x1
Definition RHIDefinitions.h:861
@ VRSSR_4x4
Definition RHIDefinitions.h:867
@ VRSSR_4x2
Definition RHIDefinitions.h:866
@ VRSSR_2x2
Definition RHIDefinitions.h:864
ERHIFeatureSupport
Definition RHIDefinitions.h:169
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition RHIDefinitions.h:95
RHI_API FDebugName()
Definition RHI.cpp:2129
uint32 ToString(TCHAR(&Out)[N]) const
Definition RHIDefinitions.h:124
return ToStringInternal(Out, OutSize)
RHI_API void AppendString(FStringBuilderBase &Builder) const
Definition RHI.cpp:2192
uint32 ToStringTruncate(TCHAR(&Out)[N]) const
Definition RHIDefinitions.h:140
static constexpr uint32 StringBufferSize
Definition RHIDefinitions.h:98
bool IsNone() const
Definition RHIDefinitions.h:146
RHI_API FString ToString() const
Definition RHI.cpp:2154
RHI_API FDebugName & operator=(FName Other)
Definition RHI.cpp:2147
UE_DEPRECATED(5.6, "FDebugName::ToString(TCHAR* Out, uint32 OutSize) is dangerous and can lead to buffer overflow if the provided " "buffer is smaller than FDebugName::StringBufferSize, even if the OutSize parameter indicates the buffer is " "smaller than this value. Use the templated ToString() or ToStringTruncate() functions to format the name " "string into a pre-allocated array, or use the allocating ToString() function that returns an FString.") uint32 ToString(TCHAR *Out
Definition NameTypes.h:617
FORCEINLINE bool IsNone() const
Definition NameTypes.h:827
static constexpr uint32 StringBufferSize
Definition NameTypes.h:708
Definition RHIDefinitions.h:315
Type
Definition RHIDefinitions.h:317
@ Forward
Definition RHIDefinitions.h:319
@ Mobile
Definition RHIDefinitions.h:320
@ Deferred
Definition RHIDefinitions.h:318
@ Num
Definition RHIDefinitions.h:321
U16 Index
Definition radfft.cpp:71
Definition RHIDefinitions.h:1401
uint32 GetIndex() const
Definition RHIDefinitions.h:1410
FRHIDescriptorHandle(ERHIDescriptorType InType, uint32 InIndex)
Definition RHIDefinitions.h:1404
FRHIDescriptorHandle()=default
ERHIDescriptorType GetType() const
Definition RHIDefinitions.h:1415
bool IsValid() const
Definition RHIDefinitions.h:1420
Definition RHIDefinitions.h:737
static uint32 Create(uint16 UniformBufferIndex, uint16 ResourceIndex, uint16 BindIndex)
Definition RHIDefinitions.h:744
static uint16 GetBindIndex(uint32 Data)
Definition RHIDefinitions.h:761
static uint16 GetUniformBufferIndex(uint32 Data)
Definition RHIDefinitions.h:751
static constexpr uint32 GetEndOfStreamToken()
Definition RHIDefinitions.h:739
static uint16 GetResourceIndex(uint32 Data)
Definition RHIDefinitions.h:756
Definition RHIDefinitions.h:1739
uint32 RefreshRate
Definition RHIDefinitions.h:1742
uint32 Width
Definition RHIDefinitions.h:1740
uint32 Height
Definition RHIDefinitions.h:1741
Definition RHIDefinitions.h:1746
uint16 BindPoint
Definition RHIDefinitions.h:1747
uint16 Stride
Definition RHIDefinitions.h:1748
Definition RHIDefinitions.h:1752
EShaderCodeResourceBindingType Type
Definition RHIDefinitions.h:1754
uint16 BindPoint
Definition RHIDefinitions.h:1753
Definition RHIDefinitions.h:1758
uint16 BindPoint
Definition RHIDefinitions.h:1759
uint32 Size
Definition RHIDefinitions.h:1760