Skip to content

LiteFX::Rendering::IDescriptorSet::bindToHeap

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

Synopsis

Declared in <litefx/rendering_api.hpp>

[[dllimport, dllexport]] UInt32 bindToHeap(
    UInt32 descriptor,
    ISampler const& sampler) const;

Description

This method is used with the GraphicsDeviceFeatures::DynamicDescriptors feature and allows to bind a descriptor to the underlying descriptor heap directly. The method returns the global heap index of the sampler, that can be used by the shader to access it using the SamplerDescriptorHeap syntax (in HLSL).

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

Exceptions

NameThrown on
RuntimeExceptionThrown, if the descriptor set does not contain a descriptor that provides direct heap access to the underlying descriptor heap indicated by bindingType.

Return Value

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

Parameters

NameDescription
descriptorThe index of the descriptor in the heap to bind sampler to.
samplerThe sampler to bind.