LiteFX::Rendering::IDescriptorLayout¶
Describes a the layout of a single descriptor within a DescriptorSet.
Synopsis¶
Declared in <litefx/rendering_api.hpp>
class [[dllimport, dllexport]] IDescriptorLayout
: public IBufferLayout
Description¶
A common metaphor for a descriptor to think of it as a "pointer for the GPU". Basically, a descriptor points to a buffer in a shader. A descriptor can have different types and sizes. The types a descriptor can have are described by the DescriptorType.
If the descriptor is a sampler, it can either be a dynamic or static sampler. A dynamic sampler needs to be bound during runtime just like any other descriptor by calling IDescriptorSet::update. A static sampler is defined alongside the descriptor layout and is automatically set when the pipeline that uses the descriptor layout gets bound. In this case, the descriptor must not be updated with another sampler. If a descriptor layout describes a static sampler, the IDescriptorLayout::staticSampler returns a pointer to the static sampler state.
Typically, a descriptor "points" to a singular buffer, i.e. a scalar. However, a descriptor can also resemble an array. In this case, IDescriptorLayout::descriptors returns the number of elements in the array. If the size of the array is not known beforehand, the descriptor can be defined as unbounded, causing the IDescriptorLayout::unbounded property to return true. In this case, the number of descriptors defines the upper limit for the actual descriptor count that can be allocated for the array when calling IDescriptorSetLayout::allocate.
Base Classes¶
| Name | Description |
|---|---|
IBufferLayout | Describes a buffer layout. |
Member Functions¶
| Name | Description |
|---|---|
~IDescriptorLayout [destructor] [virtual] | Destructor |
binding [virtual] | Returns the binding point, the buffer will be bound to. |
descriptorType [virtual] | Returns the type of the descriptor. |
descriptors [virtual] | Returns the number of descriptors in the descriptor array. |
elementSize [virtual] | Returns the size of a single element within the buffer. |
staticSampler [virtual] | If the descriptor describes a static sampler, this method returns the state of the sampler. Otherwise, it returns nullptr. |
type [virtual] | Returns the buffer type of the buffer. |
unbounded [virtual] | Returns true, if the descriptor defines an unbounded descriptor array. |
Protected Member Functions¶
| Name | Description |
|---|---|
IDescriptorLayout [constructor] | Constructors |
operator= | Assignment operators |
Derived Classes¶
| Name | Description |
|---|---|
DirectX12DescriptorLayout | Implements a DirectX 12 IDescriptorLayout |
VulkanDescriptorLayout | Implements a Vulkan IDescriptorLayout |
See Also¶
DescriptorSetLayout