UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
D3D12RHI.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 D3D12RHI.h: Public D3D RHI definitions.
5=============================================================================*/
6
7#pragma once
8
9#include "HAL/Platform.h"
10
11// Note: We do not need to worry about these counts exceeding resource binding tiers 1 & 2 due to 2 reasons:
12// 1) On PC the actual counts used to build the root signature are derived from the shader and the shader compiler
13// profile required for a desired feature level will enforce the proper limits.
14// 2) All platforms currently using the global root signature support resource binding tier 3, these counts are well within the limits
15// of tier 3.
16// More info here: https://learn.microsoft.com/en-us/windows/win32/direct3d12/hardware-support, https://en.wikipedia.org/wiki/Feature_levels_in_Direct3D
17#define MAX_SRVS 64 // Cannot be set higher than 64 due to 64b Cache.BoundMask logic
18#define MAX_SAMPLERS 32
19#define MAX_UAVS 16
20#define MAX_CBS 16
21
22#if !defined(WITH_PIX_EVENT_RUNTIME)
23 #define WITH_PIX_EVENT_RUNTIME 0
24#endif
25
26#if PLATFORM_WINDOWS
27 #define D3D12RHI_PLATFORM_HAS_UNIFIED_MEMORY 0
28 #define ENABLE_RESIDENCY_MANAGEMENT 1
29 #define PIPELINE_STATE_FILE_LOCATION FPaths::ProjectSavedDir()
30 #define USE_PIX WITH_PIX_EVENT_RUNTIME
31 #define D3D12RHI_SUPPORTS_WIN_PIX USE_PIX
32
33 #define FD3D12_TEXTURE_DATA_PITCH_ALIGNMENT D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
34#else
35 #include "D3D12RHIPlatformPublic.h"
36#endif