Skip to content

LiteFX::Rendering::GraphicsFactory::createVertexBuffer

Creates a vertex buffer, based on the layout.

Synopsis

Declared in <litefx/rendering.hpp>

virtual SharedPtr<TVertexBuffer> createVertexBuffer(
    vertex_buffer_layout_type const& layout,
    ResourceHeap heap,
    UInt32 elements = 1,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const = 0;

Description

A vertex buffer can be used by different RenderPipeline "RenderPipelines", as long as they share a common input assembler state.

The size of the buffer is computed from the element size vertex buffer layout, times the number of elements given by the elements parameter.

Return Value

The instance of the vertex buffer.

Parameters

NameDescription
layoutThe layout of the vertex buffer.
heapThe heap to allocate the buffer on.
elementsThe number of elements within the vertex buffer (i.e. the number of vertices).
usageThe intended usage for the buffer.
allocationBehaviorThe behavior controlling what happens if currently there is not enough memory available for the resource.