Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::BufferDesc Struct Reference

Buffer description. More...

#include <Buffer.h>

Inheritance diagram for Diligent::BufferDesc:
Diligent::DeviceObjectAttribs

Public Member Functions

constexpr bool operator== (const BufferDesc &RHS) const
 Tests if two buffer descriptions are equal.
 

Public Attributes

Uint64 Size = 0
 Size of the buffer, in bytes. For a uniform buffer, this must be a multiple of 16.
 
BIND_FLAGS BindFlags = BIND_NONE
 Buffer bind flags, see Diligent::BIND_FLAGS for details.
 
USAGE Usage = USAGE_DEFAULT
 Buffer usage, see Diligent::USAGE for details.
 
CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_NONE
 CPU access flags or 0 if no CPU access is allowed, see Diligent::CPU_ACCESS_FLAGS for details.
 
BUFFER_MODE Mode = BUFFER_MODE_UNDEFINED
 Buffer mode, see Diligent::BUFFER_MODE.
 
MISC_BUFFER_FLAGS MiscFlags = MISC_BUFFER_FLAG_NONE
 Miscellaneous flags, see Diligent::MISC_BUFFER_FLAGS for details.
 
Uint32 ElementByteStride = 0
 Buffer element stride, in bytes.
 
Uint64 ImmediateContextMask = 1
 Defines which immediate contexts are allowed to execute commands that use this buffer.
 
- Public Attributes inherited from Diligent::DeviceObjectAttribs
const Char * Name = nullptr
 Object name.
 

Detailed Description

Buffer description.

Member Function Documentation

◆ operator==()

bool Diligent::BufferDesc::operator== ( const BufferDesc & RHS) const
inlineconstexpr

Tests if two buffer descriptions are equal.

Parameters
[in]RHS- reference to the structure to compare with.
Returns
true if all members of the two structures except for the Name are equal, and false otherwise.
Note
The operator ignores the Name field as it is used for debug purposes and doesn't affect the buffer properties.

Member Data Documentation

◆ BindFlags

◆ ElementByteStride

Uint32 Diligent::BufferDesc::ElementByteStride = 0

Buffer element stride, in bytes.

For a structured buffer (BufferDesc::Mode equals Diligent::BUFFER_MODE_STRUCTURED) this member defines the size of each buffer element. For a formatted buffer (BufferDesc::Mode equals Diligent::BUFFER_MODE_FORMATTED) and optionally for a raw buffer (Diligent::BUFFER_MODE_RAW), this member defines the size of the format that will be used for views created for this buffer.

◆ ImmediateContextMask

Uint64 Diligent::BufferDesc::ImmediateContextMask = 1

Defines which immediate contexts are allowed to execute commands that use this buffer.

When ImmediateContextMask contains a bit at position n, the buffer may be used in the immediate context with index n directly (see DeviceContextDesc::ContextId). It may also be used in a command list recorded by a deferred context that will be executed through that immediate context.

Remarks
Only specify these bits that will indicate those immediate contexts where the buffer will actually be used. Do not set unnecessary bits as this will result in extra overhead.