Skip to content

LiteFX::Rendering::Backends::DirectX12DescriptorSet::bindToHeap

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

Synopsis

Declared in <litefx/backends/dx12.hpp>

[[dllimport, dllexport]] virtual UInt32 bindToHeap(
    UInt32 descriptor,
    IDirectX12Sampler const& sampler) const override;

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.

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.