LiteFX::Rendering::IDescriptorSet::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_api.hpp>
[[dllimport, dllexport]] UInt32 bindToHeap(
DescriptorType bindingType,
UInt32 descriptor,
IImage const& image,
UInt32 firstLevel = 0,
UInt32 levels = 0,
UInt32 firstLayer = 0,
UInt32 layers = 0) const;
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.
Exceptions¶
| Name | Thrown on |
|---|---|
RuntimeException | Thrown, 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 resource from the shader.
Parameters¶
| Name | Description |
|---|---|
| bindingType | The type of the descriptor used to bind image to the heap. |
| descriptor | The index of the descriptor in the heap to bind image to. |
| image | The image to bind. |
| firstLevel | The index of the first mip-map level to bind. |
| levels | The number of mip-map levels to bind. A value of 0 binds all available levels, starting at firstLevel. |
| firstLayer | The index of the first layer to bind. |
| layers | The number of layers to bind. A value of 0 binds all available layers, starting at firstLayer. |