Skip to content

LiteFX::Rendering::Backends::DirectX12GraphicsFactory::tryCreateIndexBuffer

Tries to create an index buffer, based on the layout.

Synopsis

Declared in <litefx/backends/dx12.hpp>

[[dllimport, dllexport]] virtual bool tryCreateIndexBuffer(
    SharedPtr<IDirectX12IndexBuffer>& buffer,
    String const& name,
    DirectX12IndexBufferLayout const& layout,
    ResourceHeap heap,
    UInt32 elements,
    ResourceUsage usage = ResourceUsage::Default,
    AllocationBehavior allocationBehavior = AllocationBehavior::Default) const override;

Return Value

true, if the buffer was created successfully and false otherwise.

Parameters

NameDescription
bufferThe instance of the buffer, or nullptr, if the buffer could not be allocated.
nameThe name of the buffer.
layoutThe layout of the index buffer.
heapThe heap to allocate the buffer on.
usageThe intended usage for the buffer.
elementsThe number of elements within the vertex buffer (i.e. the number of indices).
allocationBehaviorThe behavior controlling what happens if currently there is not enough memory available for the resource.