struct GpuBufferCreateInformation

Descriptor structure used for initialization of a GpuBuffer.

Public

Constructors

GpuBufferCreateInformation

GpuBufferCreateInformation() noexcept(false) = default

GpuBufferCreateInformation

GpuBufferCreateInformation(const GpuBufferInformation &other)

Methods

staticCreateVertex

static GpuBufferCreateInformation CreateVertex(u32 elementSize, u32 elementCount, GpuBufferFlags flags = GpuBufferFlag::StoreOnGPU)

Builds a structure that can be used for creating a GpuBuffer containing vertex information.

elementSize
Size of a single vertex in the buffer.
elementCount
Number of vertices in the buffer.
flags
Flags that control how is buffer accessed/used.

Returns: Structure that can be used for creating the buffer.

staticCreateIndex

static GpuBufferCreateInformation CreateIndex(IndexType indexType, u32 indexCount, GpuBufferFlags flags = GpuBufferFlag::StoreOnGPU)

Builds a structure that can be used for creating a GpuBuffer containing triangle indices.

indexType
Type of index contained in the buffer.
indexCount
Number of indices in the buffer.
flags
Flags that control how is buffer accessed/used.

Returns: Structure that can be used for creating the buffer.

staticCreateUniform

static GpuBufferCreateInformation CreateUniform(u32 size, GpuBufferFlags flags = GpuBufferFlag::StoreOnCPUWithGPUAccess, u32 suballocationCount = 1)

Builds a structure that can be used for creating a GpuBuffer containing uniform parameters.

size
Size of the uniform buffer.
flags
Flags that control how is buffer accessed/used.
suballocationCount
Number of buffers of requested size to create. In case you need multiple buffers of the same size this is more efficient than creating a separate GpuBuffer for each. Sub-allocated buffers can be bound for rendering by using the dynamic offset functionality provided on GpuCommandBuffer.

Returns: Structure that can be used for creating the buffer.

staticCreateSimpleStorage

static GpuBufferCreateInformation CreateSimpleStorage(GpuBufferFormat format, u32 elementCount, GpuBufferFlags flags = GpuBufferFlag::StoreOnGPU)

Builds a structure that can be used for creating a GpuBuffer that may be bound for arbitrary reads or writes, containing simple (primitive) elements.

format
Format of elements in the buffer.
elementCount
Number of elements in the buffer.
flags
Flags that control how is buffer accessed/used.

Returns: Structure that can be used for creating the buffer.

staticCreateStructuredStorage

static GpuBufferCreateInformation CreateStructuredStorage(u32 elementSize, u32 elementCount, GpuBufferFlags flags = GpuBufferFlag::StoreOnGPU)

Builds a structure that can be used for creating a GpuBuffer that may be bound for arbitrary reads or writes, containing arbitrary data.

elementSize
Size of a single element in the buffer.
elementCount
Number of elements in the buffer.
flags
Flags that control how is buffer accessed/used.

Returns: Structure that can be used for creating the buffer.

staticCreateStagingWrite

static GpuBufferCreateInformation CreateStagingWrite(u32 size)

Builds a structure that can be used for creating a GpuBuffer that can be written to by the CPU and used as a source in copy operations.

size
Size of the buffer.

Returns: Structure that can be used for creating the buffer.

staticCreateStagingRead

static GpuBufferCreateInformation CreateStagingRead(u32 size)

Builds a structure that can be used for creating a GpuBuffer that can be read by the CPU and used as a destination in copy operations.

size
Size of the buffer.

Returns: Structure that can be used for creating the buffer.

Fields

Type

Controls at which parts of the GPU pipeline is the buffer intended to be primarily used in.

Flags

GpuBufferFlags Flags

Flags that control the behavior of the buffer.

SuballocationCount

u32 SuballocationCount

Number of sub-allocated buffers to create.

Internally this will allocate memory for this many buffers, which can be bound by providing a dynamic offset when binding the buffer on GpuCommandBuffer. Binding buffers this way is more efficient than creating separate GpuBuffer for each entry.