UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
D3D12Util.h File Reference
#include "CoreMinimal.h"
#include "Containers/Queue.h"
#include "D3D12RHICommon.h"
#include "D3D12Queue.h"
#include "D3D12Access.h"
#include "DXGIUtilities.h"
#include "RenderUtils.h"
#include "ShaderCore.h"

Go to the source code of this file.

Classes

struct  FShaderRegisterCounts
 
struct  FD3D12QuantizedBoundShaderState
 
class  FD3D12LockedKey
 
class  FD3D12BoundRenderTargets
 
struct  FThreadsafeQueue< Type >
 
struct  FD3D12ScopeLock
 
struct  FD3D12ScopeNoLock
 

Namespaces

namespace  D3D12RHI
 

Macros

#define VERIFYD3D12RESULT_LAMBDA(x, Device, Lambda)   {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, Device, Lambda()); }}
 
#define VERIFYD3D12RESULT_EX(x, Device)   {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, Device); }}
 
#define VERIFYD3D12RESULT(x)   {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, nullptr); }}
 
#define VERIFYD3D12CREATETEXTURERESULT(x, Desc, Device)   {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12CreateTextureResult(hres, #x, __FILE__, __LINE__, Desc, Device); }}
 
#define ASSERT_RESOURCE_STATES   0
 

Enumerations

enum  EShaderVisibility {
  SV_Vertex , SV_Pixel , SV_Geometry , SV_All ,
  SV_ShaderVisibilityCount
}
 
enum  ERootSignatureType {
  RS_Raster , RS_RayTracingGlobal , RS_RayTracingLocal , RS_WorkGraphGlobal ,
  RS_WorkGraphLocalCompute , RS_WorkGraphLocalRaster
}
 

Functions

void D3D12RHI::VerifyD3D12Result (HRESULT D3DResult, const ANSICHAR *Code, const ANSICHAR *Filename, uint32 Line, ID3D12Device *Device, FString Message)
 
void D3D12RHI::VerifyD3D12CreateTextureResult (HRESULT D3DResult, const ANSICHAR *Code, const ANSICHAR *Filename, uint32 Line, const D3D12_RESOURCE_DESC &TextureDesc, ID3D12Device *Device)
 
void D3D12RHI::LogPageFaultData (class FD3D12Adapter *InAdapter, FD3D12Device *InDevice, D3D12_GPU_VIRTUAL_ADDRESS InPageFaultAddress)
 
bool ShouldSetD3D12ResourceName (const FD3D12ResourceLocation &ResourceLocation)
 
void SetD3D12ObjectName (ID3D12Object *Object, const TCHAR *Name)
 
void SetD3D12ResourceName (FD3D12ResourceLocation &ResourceLocation, const TCHAR *Name)
 
void SetD3D12ResourceName (FD3D12Resource *Resource, const TCHAR *Name)
 
void SetD3D12ResourceName (FD3D12Buffer *Resource, const TCHAR *Name)
 
void SetD3D12ResourceName (FD3D12Texture *Resource, const TCHAR *Name)
 
FString GetD312ObjectName (ID3D12Object *const Object)
 
FORCEINLINE uint32 GetD3D12CubeFace (ECubeFace Face)
 
FORCEINLINE uint32 CalcSubresource (uint32 MipSlice, uint32 ArraySlice, uint32 MipLevels)
 
void LogExecuteCommandLists (uint32 NumCommandLists, ID3D12CommandList *const *ppCommandLists)
 
bool IsCPUWritable (D3D12_HEAP_TYPE HeapType, const D3D12_HEAP_PROPERTIES *pCustomHeapProperties=nullptr)
 
bool IsGPUOnly (D3D12_HEAP_TYPE HeapType, const D3D12_HEAP_PROPERTIES *pCustomHeapProperties=nullptr)
 
bool IsCPUAccessible (D3D12_HEAP_TYPE HeapType, const D3D12_HEAP_PROPERTIES *pCustomHeapProperties=nullptr)
 
ED3D12Access DetermineInitialBufferD3D12Access (D3D12_HEAP_TYPE HeapType, const D3D12_HEAP_PROPERTIES *pCustomHeapProperties=nullptr)
 
FORCEINLINE_DEBUGGABLE D3D12_PRIMITIVE_TOPOLOGY_TYPE TranslatePrimitiveTopologyType (EPrimitiveTopologyType TopologyType)
 
FORCEINLINE_DEBUGGABLE D3D_PRIMITIVE_TOPOLOGY TranslatePrimitiveType (EPrimitiveType PrimitiveType)
 
FORCEINLINE_DEBUGGABLE D3D12_PRIMITIVE_TOPOLOGY_TYPE D3D12PrimitiveTypeToTopologyType (D3D_PRIMITIVE_TOPOLOGY PrimitiveType)
 
FORCEINLINE_DEBUGGABLE uint32 GetMaxMSAAQuality (uint32 SampleCount)
 
FORCEINLINE_DEBUGGABLE bool CheckResourceStateCompatibility (D3D12_RESOURCE_STATES State, D3D12_RESOURCE_FLAGS Flags, FString &IncompatibilityReason)
 

Macro Definition Documentation

◆ ASSERT_RESOURCE_STATES

#define ASSERT_RESOURCE_STATES   0

◆ VERIFYD3D12CREATETEXTURERESULT

#define VERIFYD3D12CREATETEXTURERESULT (   x,
  Desc,
  Device 
)    {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12CreateTextureResult(hres, #x, __FILE__, __LINE__, Desc, Device); }}

◆ VERIFYD3D12RESULT

#define VERIFYD3D12RESULT (   x)    {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, nullptr); }}

◆ VERIFYD3D12RESULT_EX

#define VERIFYD3D12RESULT_EX (   x,
  Device 
)    {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, Device); }}

◆ VERIFYD3D12RESULT_LAMBDA

#define VERIFYD3D12RESULT_LAMBDA (   x,
  Device,
  Lambda 
)    {HRESULT hres = x; if (FAILED(hres)) { VerifyD3D12Result(hres, #x, __FILE__, __LINE__, Device, Lambda()); }}

A macro for using VERIFYD3D12RESULT that automatically passes in the code and filename/line.

Enumeration Type Documentation

◆ ERootSignatureType

Enumerator
RS_Raster 
RS_RayTracingGlobal 
RS_RayTracingLocal 
RS_WorkGraphGlobal 
RS_WorkGraphLocalCompute 
RS_WorkGraphLocalRaster 

◆ EShaderVisibility

Enumerator
SV_Vertex 
SV_Pixel 
SV_Geometry 
SV_All 
SV_ShaderVisibilityCount 

Function Documentation

◆ CalcSubresource()

FORCEINLINE uint32 CalcSubresource ( uint32  MipSlice,
uint32  ArraySlice,
uint32  MipLevels 
)

Calculate a subresource index for a texture

◆ CheckResourceStateCompatibility()

FORCEINLINE_DEBUGGABLE bool CheckResourceStateCompatibility ( D3D12_RESOURCE_STATES  State,
D3D12_RESOURCE_FLAGS  Flags,
FString &  IncompatibilityReason 
)

◆ D3D12PrimitiveTypeToTopologyType()

FORCEINLINE_DEBUGGABLE D3D12_PRIMITIVE_TOPOLOGY_TYPE D3D12PrimitiveTypeToTopologyType ( D3D_PRIMITIVE_TOPOLOGY  PrimitiveType)

◆ DetermineInitialBufferD3D12Access()

ED3D12Access DetermineInitialBufferD3D12Access ( D3D12_HEAP_TYPE  HeapType,
const D3D12_HEAP_PROPERTIES pCustomHeapProperties = nullptr 
)
inline

◆ GetD312ObjectName()

FString GetD312ObjectName ( ID3D12Object *const  Object)

◆ GetD3D12CubeFace()

FORCEINLINE uint32 GetD3D12CubeFace ( ECubeFace  Face)

Convert from ECubeFace to D3DCUBEMAP_FACES type

Parameters
Face- ECubeFace type to convert
Returns
D3D cube face enum value

◆ GetMaxMSAAQuality()

FORCEINLINE_DEBUGGABLE uint32 GetMaxMSAAQuality ( uint32  SampleCount)

◆ IsCPUAccessible()

bool IsCPUAccessible ( D3D12_HEAP_TYPE  HeapType,
const D3D12_HEAP_PROPERTIES pCustomHeapProperties = nullptr 
)
inline

◆ IsCPUWritable()

bool IsCPUWritable ( D3D12_HEAP_TYPE  HeapType,
const D3D12_HEAP_PROPERTIES pCustomHeapProperties = nullptr 
)
inline

◆ IsGPUOnly()

bool IsGPUOnly ( D3D12_HEAP_TYPE  HeapType,
const D3D12_HEAP_PROPERTIES pCustomHeapProperties = nullptr 
)
inline

◆ LogExecuteCommandLists()

void LogExecuteCommandLists ( uint32  NumCommandLists,
ID3D12CommandList *const *  ppCommandLists 
)

◆ SetD3D12ObjectName()

void SetD3D12ObjectName ( ID3D12Object Object,
const TCHAR Name 
)

◆ SetD3D12ResourceName() [1/4]

void SetD3D12ResourceName ( FD3D12Buffer Resource,
const TCHAR Name 
)

◆ SetD3D12ResourceName() [2/4]

void SetD3D12ResourceName ( FD3D12Resource Resource,
const TCHAR Name 
)

◆ SetD3D12ResourceName() [3/4]

void SetD3D12ResourceName ( FD3D12ResourceLocation ResourceLocation,
const TCHAR Name 
)

◆ SetD3D12ResourceName() [4/4]

void SetD3D12ResourceName ( FD3D12Texture Resource,
const TCHAR Name 
)

◆ ShouldSetD3D12ResourceName()

bool ShouldSetD3D12ResourceName ( const FD3D12ResourceLocation ResourceLocation)

◆ TranslatePrimitiveTopologyType()

FORCEINLINE_DEBUGGABLE D3D12_PRIMITIVE_TOPOLOGY_TYPE TranslatePrimitiveTopologyType ( EPrimitiveTopologyType  TopologyType)

◆ TranslatePrimitiveType()

FORCEINLINE_DEBUGGABLE D3D_PRIMITIVE_TOPOLOGY TranslatePrimitiveType ( EPrimitiveType  PrimitiveType)