ezEngine Release 26.9
Loading...
Searching...
No Matches
ezGALResourceState Struct Reference

Describes the usage state of a GPU resource for barrier and layout transition purposes. More...

#include <Enumerations.h>

Classes

struct  Bits
 

Public Types

enum  Enum : ezUInt32 {
  Unknown = 0 , ShaderResource = EZ_BIT(0) , ConstantBuffer = EZ_BIT(1) , VertexBuffer = EZ_BIT(2) ,
  IndexBuffer = EZ_BIT(3) , DrawIndirect = EZ_BIT(4) , DepthStencilRead = EZ_BIT(5) , CopySource = EZ_BIT(6) ,
  ResolveSource = EZ_BIT(7) , UnorderedAccess = EZ_BIT(16) , RenderTarget = EZ_BIT(17) , DepthStencilWrite = EZ_BIT(18) ,
  CopyDestination = EZ_BIT(19) , ResolveDestination = EZ_BIT(20) , Discard = EZ_BIT(28) , Present = EZ_BIT(29) ,
  CpuRead = EZ_BIT(30) , CpuWrite = EZ_BIT(31) , AllTextureStates = ShaderResource | DepthStencilRead | CopySource | ResolveSource | UnorderedAccess | RenderTarget | DepthStencilWrite | CopyDestination | ResolveDestination | Discard , AllBufferStates = ShaderResource | ConstantBuffer | VertexBuffer | IndexBuffer | DrawIndirect | CopySource | UnorderedAccess | CopyDestination ,
  AllReadStates = ShaderResource | ConstantBuffer | VertexBuffer | IndexBuffer | DrawIndirect | DepthStencilRead | CopySource | ResolveSource , AllWriteStates = UnorderedAccess | RenderTarget | DepthStencilWrite | CopyDestination | ResolveDestination | Discard , Default = Unknown
}
 
using StorageType = ezUInt32
 

Detailed Description

Describes the usage state of a GPU resource for barrier and layout transition purposes.

Read-only states can be combined via bitwise OR when a resource is used for multiple read purposes simultaneously (buffers ONLY, e.g., sampled in a shader while also bound as a vertex buffer). Write states are exclusive and must not be combined with other states.

Not every state is valid for every resource type. Using an invalid state (e.g., RenderTarget on a buffer) is a usage error.

Member Enumeration Documentation

◆ Enum

enum ezGALResourceState::Enum : ezUInt32
Enumerator
ShaderResource 

Texture/buffer read by a shader stage.

ConstantBuffer 

Bound as a constant/uniform buffer.

VertexBuffer 

Bound as a vertex buffer.

IndexBuffer 

Bound as an index buffer.

DrawIndirect 

Indirect draw/dispatch argument buffer.

DepthStencilRead 

Depth/stencil attachment without writes.

CopySource 

Source of a copy or blit operation.

ResolveSource 

Source of an MSAA resolve.

UnorderedAccess 

UAV/storage write.

RenderTarget 

Color render target attachment.

DepthStencilWrite 

Depth/stencil attachment with writes (implies read)

CopyDestination 

Destination of a copy or blit operation.

ResolveDestination 

Destination of an MSAA resolve.

Discard 

Textures write only: The previous data / layout can be discarded.

Present 

Swapchain presentation.

CpuRead 

GPU->CPU readback (e.g., into a staging buffer)

CpuWrite 

CPU->GPU upload (e.g., from a staging buffer)


The documentation for this struct was generated from the following file: