LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::BufferDescriptor Struct Reference

Hardware buffer descriptor structure. More...

#include <BufferFlags.h>

Public Member Functions

 BufferDescriptor ()=default
 BufferDescriptor (const BufferDescriptor &)=default
 BufferDescriptor (BufferDescriptor &&)=default
BufferDescriptor & operator= (const BufferDescriptor &)=default
BufferDescriptor & operator= (BufferDescriptor &&)=default
 ~BufferDescriptor ()=default

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
std::uint64_t size = 0
 Buffer size (in bytes). This must not be larger than RenderingLimits::maxBufferSize. By default 0.
std::uint32_t stride = 0
 Optional stride for vertex and structured buffers. By default 0.
Format format = Format::Undefined
 Optional hardware buffer format. By default Format::Undefined.
long bindFlags = 0
 These flags describe to which resource slots the buffer can be bound. By default 0.
long cpuAccessFlags = 0
 CPU read/write access flags. By default 0.
long miscFlags = 0
 Miscellaneous buffer flags. By default 0.
ArrayView< VertexAttribute > vertexAttribs

Detailed Description

Hardware buffer descriptor structure.

See also
RenderSystem::CreateBuffer

Constructor & Destructor Documentation

◆ BufferDescriptor() [1/3]

LLGL::BufferDescriptor::BufferDescriptor ( )
default

◆ BufferDescriptor() [2/3]

LLGL::BufferDescriptor::BufferDescriptor ( const BufferDescriptor & )
default

◆ BufferDescriptor() [3/3]

LLGL::BufferDescriptor::BufferDescriptor ( BufferDescriptor && )
default

◆ ~BufferDescriptor()

LLGL::BufferDescriptor::~BufferDescriptor ( )
default

Member Function Documentation

◆ operator=() [1/2]

BufferDescriptor & LLGL::BufferDescriptor::operator= ( BufferDescriptor && )
default

◆ operator=() [2/2]

BufferDescriptor & LLGL::BufferDescriptor::operator= ( const BufferDescriptor & )
default

Member Data Documentation

◆ bindFlags

long LLGL::BufferDescriptor::bindFlags = 0

These flags describe to which resource slots the buffer can be bound. By default 0.

Remarks
When the buffer will be bound to a vertex buffer slot for instance, the BindFlags::VertexBuffer flag is required.
See also
BindFlags

◆ cpuAccessFlags

long LLGL::BufferDescriptor::cpuAccessFlags = 0

CPU read/write access flags. By default 0.

Remarks
If this is 0 the buffer cannot be mapped between GPU and CPU memory space.
See also
CPUAccessFlags
RenderSystem::MapBuffer
RenderSystem::ReadBuffer
RenderSystem::WriteBuffer

◆ debugName

const char* LLGL::BufferDescriptor::debugName = nullptr

Optional name for debugging purposes. By default null.

Remarks
The final name of the native hardware resource is implementation defined.
See also
RenderSystemChild::SetDebugName

◆ format

Format LLGL::BufferDescriptor::format = Format::Undefined

Optional hardware buffer format. By default Format::Undefined.

Remarks
This is used for index buffers, typed buffers (e.g. Buffer<uint4> and RWBuffer<float4> in HLSL), and byte address buffers (i.e. ByteAddressBuffer and RWByteAddressBuffer in HLSL).
This field is ignored if the binding flags do not contain at least one of the following bits: BindFlags::IndexBuffer, BindFlags::Sampled, or BindFlags::Storage.
If the BindFlags::IndexBuffer bit is set, this must be either Format::R16UInt, Format::R32UInt, or Format::Undefined.
If Format::Undefined is specified and the BindFlags::IndexBuffer bit is set, only the secondary SetIndexBuffer function can be used in the CommandBuffer interface.
If Format::Undefined is specified and stride is zero, sampled and storage buffers (i.e. buffer views with BindFlags::Sampled and BindFlags::Storage respectively) will be interpreted as byte address buffers.
See also
BindFlags::IndexBuffer
CommandBuffer::SetIndexBuffer(Buffer&)

◆ miscFlags

long LLGL::BufferDescriptor::miscFlags = 0

Miscellaneous buffer flags. By default 0.

Remarks
This can be used as a hint for the renderer how frequently the buffer will be updated.
See also
MiscFlags

◆ size

std::uint64_t LLGL::BufferDescriptor::size = 0

Buffer size (in bytes). This must not be larger than RenderingLimits::maxBufferSize. By default 0.

Remarks
If stride is greater than zero, then size must be a multiple of stride.
See also
RenderingLimits::maxBufferSize
bindFlags

◆ stride

std::uint32_t LLGL::BufferDescriptor::stride = 0

Optional stride for vertex and structured buffers. By default 0.

Remarks
This can be used for vertex buffers to describe the stride (in bytes) between vertices. If this is zero, the stride must be set via the extended SetVertexBuffer function.
This is also used for Direct3D structured buffer, i.e. StructuredBuffer, RWStructuredBuffer, AppendStructuredBuffer, and ConsumeStructuredBuffer in HLSL.
If this is non-zero, the format attribute is ignored for sampled and storage buffers, i.e. buffers with the binding flags BindFlags::Sampled or BindFlags::Storage.
To create a typed-buffer, this must be zero unless bindFlags also contains BindFlags::VertexBuffer since vertex buffers and structured buffers are mutually exclusive in D3D.
Note
If the buffer has the binding flag BindFlags::IndirectBuffer, this must be 0.
See also
SetVertexBuffer(Buffer&, std::uint32_t, std::uint64_t)
MiscFlags::Append
MiscFlags::Counter
IsTypedBuffer
IsStructuredBuffer

◆ vertexAttribs


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