LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet > Class Template Referenceabstract

Describes the layout of a descriptor set. More...

#include <rendering.hpp>

Inherits LiteFX::Rendering::IDescriptorSetLayout.

Public Types

using descriptor_layout_type = TDescriptorLayout
 
using descriptor_set_type = TDescriptorSet
 

Public Member Functions

 ~DescriptorSetLayout () noexcept override=default
 
virtual const Array< descriptor_layout_type > & descriptors () const noexcept=0
 
const descriptor_layout_typedescriptor (UInt32 binding) const override=0
 Returns the descriptor layout for the descriptor bound to the binding point provided with binding .
Parameters
bindingThe binding point of the requested descriptor layout.
Returns
The descriptor layout for the descriptor bound to the binding point provided with binding .

 
virtual UniquePtr< descriptor_set_typeallocate (std::initializer_list< DescriptorBinding > bindings={ }) const
 
virtual UniquePtr< descriptor_set_typeallocate (Span< DescriptorBinding > bindings) const
 
virtual UniquePtr< descriptor_set_typeallocate (Generator< DescriptorBinding > bindings) const
 
virtual UniquePtr< descriptor_set_typeallocate (UInt32 descriptors, std::initializer_list< DescriptorBinding > bindings) const =0
 
virtual UniquePtr< descriptor_set_typeallocate (UInt32 descriptors, Span< DescriptorBinding > bindings) const =0
 
virtual UniquePtr< descriptor_set_typeallocate (UInt32 descriptors, Generator< DescriptorBinding > bindings) const =0
 
virtual Generator< UniquePtr< descriptor_set_type > > allocate (UInt32 descriptorSets, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
 
virtual Generator< UniquePtr< descriptor_set_type > > allocate (UInt32 descriptorSets, std::function< Generator< DescriptorBinding >(UInt32)> bindings) const
 
virtual Generator< UniquePtr< descriptor_set_type > > allocate (UInt32 descriptorSets, UInt32 descriptors, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const =0
 
virtual Generator< UniquePtr< descriptor_set_type > > allocate (UInt32 descriptorSets, UInt32 descriptors, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const =0
 
virtual void free (const descriptor_set_type &descriptorSet) const =0
 
void free (const IDescriptorSet &descriptorSet) const
 Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one.
 
- Public Member Functions inherited from LiteFX::Rendering::IDescriptorSetLayout
 ~IDescriptorSetLayout () noexcept override=default
 
Enumerable< const IDescriptorLayout & > descriptors () const noexcept
 Returns the layouts of the descriptors within the descriptor set.
 
virtual UInt32 space () const noexcept=0
 Returns the space index of the descriptor set.
 
virtual ShaderStage shaderStages () const noexcept=0
 Returns the shader stages, the descriptor set is used in.
 
virtual UInt32 uniforms () const noexcept=0
 Returns the number of uniform/constant buffer descriptors within the descriptor set.
 
virtual UInt32 storages () const noexcept=0
 Returns the number of structured and byte address buffer descriptors within the descriptor set.
 
virtual UInt32 images () const noexcept=0
 Returns the number of image (i.e. texture) descriptors within the descriptor set.
 
virtual UInt32 buffers () const noexcept=0
 Returns the number of texel buffer descriptors within the descriptor set.
 
virtual UInt32 samplers () const noexcept=0
 Returns the number of dynamic sampler descriptors within the descriptor set.
 
virtual UInt32 staticSamplers () const noexcept=0
 Returns the number of static or immutable sampler descriptors within the descriptor set.
 
virtual UInt32 inputAttachments () const noexcept=0
 Returns the number of input attachment descriptors within the descriptor set.
 
UniquePtr< IDescriptorSetallocate (std::initializer_list< DescriptorBinding > bindings={ }) const
 Allocates a new descriptor set or returns an instance of an unused descriptor set.
 
UniquePtr< IDescriptorSetallocate (Span< DescriptorBinding > bindings) const
 
UniquePtr< IDescriptorSetallocate (Generator< DescriptorBinding > bindings) const
 
UniquePtr< IDescriptorSetallocate (UInt32 descriptors, std::initializer_list< DescriptorBinding > bindings) const
 Allocates a new descriptor set or returns an instance of an unused descriptor set.
 
UniquePtr< IDescriptorSetallocate (UInt32 descriptors, Span< DescriptorBinding > bindings) const
 
UniquePtr< IDescriptorSetallocate (UInt32 descriptors, Generator< DescriptorBinding > bindings) const
 Allocates an array of descriptor sets.
 
Generator< UniquePtr< IDescriptorSet > > allocate (UInt32 descriptorSets, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
 Allocates an array of descriptor sets.
 
Generator< UniquePtr< IDescriptorSet > > allocate (UInt32 descriptorSets, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const
 Allocates an array of descriptor sets.
 
Generator< UniquePtr< IDescriptorSet > > allocate (UInt32 descriptorSets, UInt32 descriptors, std::initializer_list< std::initializer_list< DescriptorBinding > > bindings={ }) const
 Allocates an array of descriptor sets.
 
Generator< UniquePtr< IDescriptorSet > > allocate (UInt32 descriptorSets, UInt32 descriptors, std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory) const
 Allocates an array of descriptor sets.
 
void free (const IDescriptorSet &descriptorSet) const
 Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one.
 
- Public Member Functions inherited from LiteFX::SharedObject
virtual ~SharedObject () noexcept=default
 Destroys the shared object.
 
template<typename TSelf >
auto shared_from_this (this TSelf &&self) noexcept
 Returns a shared pointer to the current object instance.
 
template<typename TSelf >
auto weak_from_this (this TSelf &&self) noexcept -> WeakPtr< std::remove_reference_t< TSelf > >
 Returns a weak pointer to the current object instance.
 

Protected Member Functions

 DescriptorSetLayout () noexcept=default
 
 DescriptorSetLayout (const DescriptorSetLayout &)=default
 
 DescriptorSetLayout (DescriptorSetLayout &&) noexcept=default
 
DescriptorSetLayoutoperator= (const DescriptorSetLayout &)=default
 
DescriptorSetLayoutoperator= (DescriptorSetLayout &&) noexcept=default
 
- Protected Member Functions inherited from LiteFX::Rendering::IDescriptorSetLayout
 IDescriptorSetLayout () noexcept=default
 
 IDescriptorSetLayout (const IDescriptorSetLayout &)=default
 
 IDescriptorSetLayout (IDescriptorSetLayout &&) noexcept=default
 
IDescriptorSetLayoutoperator= (const IDescriptorSetLayout &)=default
 
IDescriptorSetLayoutoperator= (IDescriptorSetLayout &&) noexcept=default
 
- Protected Member Functions inherited from LiteFX::SharedObject
 SharedObject () noexcept=default
 Initializes a new shared object.
 
 SharedObject (SharedObject &&) noexcept=default
 
 SharedObject (const SharedObject &)=default
 
SharedObjectoperator= (SharedObject &&) noexcept=default
 
SharedObjectoperator= (const SharedObject &)=default
 

Additional Inherited Members

- Static Protected Member Functions inherited from LiteFX::SharedObject
template<typename T , typename... TArgs>
static auto create (TArgs &&... args) -> SharedPtr< T >
 Generic factory method used to create instances of the shared object.
 

Detailed Description

template<typename TDescriptorLayout, typename TDescriptorSet>
requires meta::implements<TDescriptorLayout, IDescriptorLayout> && meta::implements<TDescriptorSet, DescriptorSet<typename TDescriptorSet::buffer_type, typename TDescriptorSet::image_type, typename TDescriptorSet::sampler_type, typename TDescriptorSet::acceleration_structure_type>>
class LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >

Describes the layout of a descriptor set.

A descriptor set groups together multiple descriptors. This concept is identified by the set keyword in GLSL and space in HLSL.

For more information on buffer binding and resource management, refer to the remarks of the DescriptorSet interface.

Template Parameters
TDescriptorLayoutThe type of the descriptor layout. Must implement IDescriptorLayout.
TDescriptorSetThe type of the descriptor set. Must implement DescriptorSet.
See also
IDescriptorLayout, DescriptorSet

Member Typedef Documentation

◆ descriptor_layout_type

template<typename TDescriptorLayout , typename TDescriptorSet >
using LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::descriptor_layout_type = TDescriptorLayout

◆ descriptor_set_type

template<typename TDescriptorLayout , typename TDescriptorSet >
using LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::descriptor_set_type = TDescriptorSet

Constructor & Destructor Documentation

◆ DescriptorSetLayout() [1/3]

template<typename TDescriptorLayout , typename TDescriptorSet >
LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::DescriptorSetLayout ( )
protecteddefaultnoexcept

◆ DescriptorSetLayout() [2/3]

template<typename TDescriptorLayout , typename TDescriptorSet >
LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::DescriptorSetLayout ( const DescriptorSetLayout< TDescriptorLayout, TDescriptorSet > & )
protecteddefault

◆ DescriptorSetLayout() [3/3]

template<typename TDescriptorLayout , typename TDescriptorSet >
LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::DescriptorSetLayout ( DescriptorSetLayout< TDescriptorLayout, TDescriptorSet > && )
protecteddefaultnoexcept

◆ ~DescriptorSetLayout()

template<typename TDescriptorLayout , typename TDescriptorSet >
LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::~DescriptorSetLayout ( )
overridedefaultnoexcept

Member Function Documentation

◆ allocate() [1/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( Generator< DescriptorBinding > bindings) const
inlinevirtual

◆ allocate() [2/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( Span< DescriptorBinding > bindings) const
inlinevirtual

◆ allocate() [3/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( std::initializer_list< DescriptorBinding > bindings = { }) const
inlinevirtual

◆ allocate() [4/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptors,
Generator< DescriptorBinding > bindings ) const
pure virtual

◆ allocate() [5/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptors,
Span< DescriptorBinding > bindings ) const
pure virtual

◆ allocate() [6/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual UniquePtr< descriptor_set_type > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptors,
std::initializer_list< DescriptorBinding > bindings ) const
pure virtual

◆ allocate() [7/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual Generator< UniquePtr< descriptor_set_type > > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptorSets,
std::function< Generator< DescriptorBinding >(UInt32)> bindings ) const
inlinevirtual

◆ allocate() [8/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual Generator< UniquePtr< descriptor_set_type > > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptorSets,
std::initializer_list< std::initializer_list< DescriptorBinding > > bindings = { } ) const
inlinevirtual

◆ allocate() [9/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual Generator< UniquePtr< descriptor_set_type > > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptorSets,
UInt32 descriptors,
std::function< Generator< DescriptorBinding >(UInt32)> bindingFactory ) const
pure virtual

◆ allocate() [10/10]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual Generator< UniquePtr< descriptor_set_type > > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocate ( UInt32 descriptorSets,
UInt32 descriptors,
std::initializer_list< std::initializer_list< DescriptorBinding > > bindings = { } ) const
pure virtual

◆ descriptor()

template<typename TDescriptorLayout , typename TDescriptorSet >
const descriptor_layout_type & LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::descriptor ( UInt32 binding) const
overridepure virtual

Returns the descriptor layout for the descriptor bound to the binding point provided with binding .

Parameters
bindingThe binding point of the requested descriptor layout.
Returns
The descriptor layout for the descriptor bound to the binding point provided with binding .

Implements LiteFX::Rendering::IDescriptorSetLayout.

Implemented in LiteFX::Rendering::Backends::DirectX12DescriptorSetLayout, and LiteFX::Rendering::Backends::VulkanDescriptorSetLayout.

◆ descriptors()

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual const Array< descriptor_layout_type > & LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::descriptors ( ) const
pure virtualnoexcept

◆ free() [1/2]

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual void LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::free ( const descriptor_set_type & descriptorSet) const
pure virtual

◆ free() [2/2]

template<typename TDescriptorLayout , typename TDescriptorSet >
void LiteFX::Rendering::IDescriptorSetLayout::free ( const IDescriptorSet & descriptorSet) const
inline

Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one.

See also
allocate

◆ operator=() [1/2]

template<typename TDescriptorLayout , typename TDescriptorSet >
DescriptorSetLayout & LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::operator= ( const DescriptorSetLayout< TDescriptorLayout, TDescriptorSet > & )
protecteddefault

◆ operator=() [2/2]

template<typename TDescriptorLayout , typename TDescriptorSet >
DescriptorSetLayout & LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::operator= ( DescriptorSetLayout< TDescriptorLayout, TDescriptorSet > && )
protecteddefaultnoexcept