UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RHIAccess.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7
8class FString;
9
10enum class ERHIAccess : uint32
11{
12 // Used when the previous state of a resource is not known,
13 // which implies we have to flush all GPU caches etc.
14 Unknown = 0,
15
16 // Read states
17 CPURead = 1 << 0,
18 Present = 1 << 1,
19 IndirectArgs = 1 << 2,
20 VertexOrIndexBuffer = 1 << 3,
21 SRVCompute = 1 << 4,
22 SRVGraphicsPixel = 1 << 5,
23 SRVGraphicsNonPixel = 1 << 6,
24 CopySrc = 1 << 7,
25 ResolveSrc = 1 << 8,
26 DSVRead = 1 << 9,
27
28 // Read-write states
29 UAVCompute = 1 << 10,
30 UAVGraphics = 1 << 11,
31 RTV = 1 << 12,
32 CopyDest = 1 << 13,
33 ResolveDst = 1 << 14,
34 DSVWrite = 1 << 15,
35
36 // Ray tracing acceleration structure states.
37 // Buffer that contains an AS must always be in either of these states.
38 // BVHRead -- required for AS inputs to build/update/copy/trace commands.
39 // BVHWrite -- required for AS outputs of build/update/copy commands.
40 BVHRead = 1 << 16,
41 BVHWrite = 1 << 17,
42
43 // Invalid released state (transient resources)
44 Discard = 1 << 18,
45
46 // Shading Rate Source
47 ShadingRateSource = 1 << 19,
48
50 None = Unknown,
51 Mask = (Last << 1) - 1,
52
53 // Graphics is a combination of pixel and non-pixel
55
56 // A mask of the two possible SRV states
58
59 // A mask of the two possible UAV states
61
62 // A mask of all bits representing read-only states which cannot be combined with other write states.
64
65 // A mask of all bits representing read-only states on the compute pipe which cannot be combined with other write states.
67
68 // A mask of all bits representing read-only states which may be combined with other write states.
70
71 // A mask of all bits representing readable states which may also include writable states.
73
74 // A mask of all bits representing write-only states which cannot be combined with other read states.
76
77 // A mask of all bits representing write-only states which may be combined with other read states.
79
80 // A mask of all bits representing writable states which may also include readable states.
82};
84
89
90inline constexpr bool IsReadOnlyAccess(ERHIAccess Access)
91{
93}
94
95inline constexpr bool IsWriteOnlyAccess(ERHIAccess Access)
96{
98}
99
100inline constexpr bool IsWritableAccess(ERHIAccess Access)
101{
103}
104
105inline constexpr bool IsReadableAccess(ERHIAccess Access)
106{
108}
109
116
117inline constexpr bool IsValidAccess(ERHIAccess Access)
118{
119 return !IsInvalidAccess(Access);
120}
121
124
127
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
constexpr bool IsWritableAccess(ERHIAccess Access)
Definition RHIAccess.h:100
ERHIAccess
Definition RHIAccess.h:11
@ SRVGraphicsNonPixel
@ ReadOnlyExclusiveComputeMask
@ ReadOnlyExclusiveMask
@ VertexOrIndexBuffer
@ WriteOnlyExclusiveMask
constexpr bool IsValidAccess(ERHIAccess Access)
Definition RHIAccess.h:117
RHI_API ERHIAccess GRHIMergeableAccessMask
Definition RHI.cpp:1240
constexpr bool IsReadOnlyExclusiveAccess(ERHIAccess Access)
Definition RHIAccess.h:85
constexpr bool IsWriteOnlyAccess(ERHIAccess Access)
Definition RHIAccess.h:95
constexpr bool IsInvalidAccess(ERHIAccess Access)
Definition RHIAccess.h:110
constexpr bool IsReadableAccess(ERHIAccess Access)
Definition RHIAccess.h:105
constexpr bool IsReadOnlyAccess(ERHIAccess Access)
Definition RHIAccess.h:90
RHI_API ERHIAccess GRHIMultiPipelineMergeableAccessMask
Definition RHI.cpp:1243
RHI_API ERHIAccess GRHIMultiSubresourceDiscardIntermediateAccess
Definition RHI.cpp:1245
uint32_t uint32
Definition binka_ue_file_header.h:6