Defines the properties of a buffer resource.
typedef struct D3D11_BUFFER_DESC {
UINT ByteWidth;
D3D11_USAGE Usage;
UINT BindFlags;
UINT CPUAccessFlags;
UINT MiscFlags;
UINT StructureByteStride;
} D3D11_BUFFER_DESC;
ByteWidth
Size of the buffer in bytes. This member cannot be zero.
Usage
A D3D11_USAGE-typed value that specifies how the buffer will be used. See Remarks.
BindFlags
A combination of D3D11_BIND_FLAG-typed values that specify how the buffer will be bound to the pipeline.
CPUAccessFlags
A combination of D3D11_CPU_ACCESS_FLAG-typed values that specify the CPU's random access methods to the buffer.
MiscFlags
A combination of D3D11_RESOURCE_MISC_FLAG-typed values that specify other, less common resource settings. See Remarks.
StructureByteStride
The size of each component (in bytes) in a typed buffer (e.g., vertex buffer, index buffer, shader resource buffer, unordered access buffer).
If the buffer is not a typed buffer, this member is typically set to 0.
This structure is used with the following methods:
Buffers are used to store data that the pipeline can access. This includes vertex data, index data, constant data, shader resources, and unordered access resources.
BindFlags
to D3D11_BIND_CONSTANT_BUFFER
. The Usage
member should typically be set to D3D11_USAGE_DYNAMIC
, and CPUAccessFlags
should be set to D3D11_CPU_ACCESS_WRITE
. The ByteWidth
member must be a multiple of 16 bytes.
StructureByteStride
member has specific requirements. For example, for structured buffers and unordered access buffers, this member must be a multiple of 16 bytes and must be large enough to hold one element of the structure.
Component | Value |
---|---|
Minimum supported client | Windows 7 (minimum 6.1) |
Minimum supported server | Windows Server 2008 R2 |
Header | d3d11.h |
Library | D3D11.lib |
DLL | D3D11.dll |