Skip to content

LiteFX::Rendering::Backends::VulkanDescriptorSet::bindToHeap

Binds a resource directly to a descriptor heap and returns the index that can be used to access it.

Synopsis

Declared in <litefx/rendering.hpp>

[[dllimport]] virtual UInt32 bindToHeap(
    DescriptorType bindingType,
    UInt32 descriptor,
    buffer_type const& buffer,
    UInt32 bufferElement = 0,
    UInt32 elements = 0,
    Format texelFormat = Format::None) const = 0;

Description

This method is used with the GraphicsDeviceFeatures::DynamicDescriptors feature and allows to bind a descriptor to the underlying descriptor heap directly by providing the corresponding resource type (indicated by bindingType) at bind time. The method directly returns the global heap index of the resource, that can be used by the shader to access it using the ResourceDescriptorHeap syntax (in HLSL).

If the descriptor set does not contain a descriptor of type DescriptorType::ResourceDescriptorHeap, this method will throw an exception.

Return Value

The global heap index that can be used to access the resource from the shader.

Parameters

NameDescription
bindingTypeThe type of the descriptor used to bind buffer to the heap.
descriptorThe index of the descriptor in the heap to bind buffer to.
bufferThe buffer to bind.
bufferElementThe index of an element inside buffer that should be bound.
elementsThe number of elements from the buffer to bind to the descriptor set. A value of 0 binds all available elements, starting at bufferElement.
texelFormatThe format used to read a texel buffer. Required if binding binds a texel buffer and ignored otherwise.