Diligent Engine API Reference
Classes | Public Member Functions | Public Attributes | List of all members
Diligent::BufferDesc Struct Reference

Buffer description. More...

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

Classes

struct  BufferFormat
 Buffer format description. More...
 

Public Member Functions

 BufferDesc ()
 Initializes the structure members with default values. More...
 
bool operator== (const BufferDesc &RHS) const
 Tests if two structures are equivalent. More...
 
- Public Member Functions inherited from Diligent::DeviceObjectAttribs
 DeviceObjectAttribs ()
 Constructor intializes the structure members with default values.
 

Public Attributes

Uint32 uiSizeInBytes
 Size of the buffer, in bytes. For a uniform buffer, this must be multiple of 16.
 
Uint32 BindFlags
 Buffer bind flags, see Diligent::BIND_FLAGS for details. More...
 
USAGE Usage
 Buffer usage, see Diligent::USAGE for details.
 
Uint32 CPUAccessFlags
 CPU access flags or 0 if no CPU access is allowed, see Diligent::CPU_ACCESS_FLAG for details.
 
BUFFER_MODE Mode
 Buffer mode.
 
BufferFormat Format
 Buffer format. More...
 
Uint32 ElementByteStride
 Buffer element stride, in bytes. For a structured buffer (BufferDesc::Mode equals Diligent::BUFFER_MODE_STRUCTURED), this member cannot be zero. For a formatted buffer (BufferDesc::Mode equals Diligent::BUFFER_MODE_FORMATTED), this member can either specify the stride, or be 0. In the latter case, the stride is computed automatically based on the format size and assuming that elements are densely packed.
 
- Public Attributes inherited from Diligent::DeviceObjectAttribs
const Char * Name
 Object name.
 

Detailed Description

Buffer description.

Constructor & Destructor Documentation

◆ BufferDesc()

Diligent::BufferDesc::BufferDesc ( )
inline

Initializes the structure members with default values.

Default values:

Member Default value
uiSizeInBytes 0
BindFlags 0
Usage Diligent::USAGE_DEFAULT
CPUAccessFlags 0
Mode Diligent::BUFFER_MODE_UNDEFINED
ElementByteStride 0

Members of BufferDesc::Format are initialized with default values by BufferFormat::BufferFormat()

Member Function Documentation

◆ operator==()

bool Diligent::BufferDesc::operator== ( const BufferDesc RHS) const
inline

Tests if two structures are equivalent.

Parameters
[in]RHS- reference to the structure to perform comparison with
Returns
  • True if all members of the two structures except for the Name are equal.
  • False otherwise. The operator ignores DeviceObjectAttribs::Name field as it does not affect the buffer description.

Member Data Documentation

◆ BindFlags

Uint32 Diligent::BufferDesc::BindFlags

◆ Format

BufferFormat Diligent::BufferDesc::Format

Buffer format.

For a formatted buffer (BufferDesc::Mode equals Diligent::BUFFER_MODE_FORMATTED), this member describes the buffer format, see BufferFormat. Ignored otherwise.