D3D11_BUFFER_DESC structure (d3d11.h)

Describes a buffer resource.

Syntax

typedef struct D3D11_BUFFER_DESC {
  UINT        ByteWidth;
  D3D11_USAGE Usage;
  UINT        BindFlags;
  UINT        CPUAccessFlags;
  UINT        MiscFlags;
  UINT        StructureByteStride;
} D3D11_BUFFER_DESC;

Members

ByteWidth

Type: UINT

Size of the buffer in bytes.

Usage

Type: D3D11_USAGE

Identify how the buffer is expected to be read from and written to. Frequency of update is a key factor. The most common value is typically D3D11_USAGE_DEFAULT; see D3D11_USAGE for all possible values.

BindFlags

Type: UINT

Identify how the buffer will be bound to the pipeline. Flags (see D3D11_BIND_FLAG) can be combined with a bitwise OR.

CPUAccessFlags

Type: UINT

CPU access flags (see D3D11_CPU_ACCESS_FLAG) or 0 if no CPU access is necessary. Flags can be combined with a bitwise OR.

MiscFlags

Type: UINT

Miscellaneous flags (see D3D11_RESOURCE_MISC_FLAG) or 0 if unused. Flags can be combined with a bitwise OR.

StructureByteStride

Type: UINT

The size of each element in the buffer structure (in bytes) when the buffer represents a structured buffer. For more info about structured buffers, see Structured Buffer.

The size value in StructureByteStride must match the size of the format that you use for views of the buffer. For example, if you use a shader resource view (SRV) to read a buffer in a pixel shader, the SRV format size must match the size value in StructureByteStride.

Remarks

This structure is used by ID3D11Device::CreateBuffer to create buffer resources.

In addition to this structure, you can also use the CD3D11_BUFFER_DESC derived structure, which is defined in D3D11.h and behaves like an inherited class, to help create a buffer description.

If the bind flag is D3D11_BIND_CONSTANT_BUFFER, you must set the ByteWidth value in multiples of 16, and less than or equal to D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT.

Requirements

Requirement Value
Header d3d11.h

See also

Resource Structures