LiteFX 0.3.1.2022
Computer Graphics Engine
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

virtual ~DescriptorSetLayout () noexcept=default
 
virtual Array< const descriptor_layout_type * > descriptors () const noexcept=0
 
virtual const descriptor_layout_typedescriptor (const UInt32 &binding) const =0
 Returns the descriptor layout for the descriptor bound to the binding point provided with binding . More...
 
virtual UniquePtr< descriptor_set_typeallocate (const UInt32 &descriptors=0) const =0
 
virtual Array< UniquePtr< descriptor_set_type > > allocateMultiple (const UInt32 &descriptorSets, const UInt32 &descriptors=0) const =0
 
virtual void free (const descriptor_set_type &descriptorSet) const noexcept=0
 
- Public Member Functions inherited from LiteFX::Rendering::IDescriptorSetLayout
virtual ~IDescriptorSetLayout () noexcept=default
 
Array< const IDescriptorLayout * > descriptors () const noexcept
 Returns the layouts of the descriptors within the descriptor set. More...
 
virtual const IDescriptorLayoutdescriptor (const UInt32 &binding) const =0
 Returns the descriptor layout for the descriptor bound to the binding point provided with binding . More...
 
virtual const UInt32space () const noexcept=0
 Returns the space index of the descriptor set. More...
 
virtual const ShaderStage & shaderStages () const noexcept=0
 Returns the shader stages, the descriptor set is used in. More...
 
virtual UInt32 uniforms () const noexcept=0
 Returns the number of uniform/constant buffer descriptors within the descriptor set. More...
 
virtual UInt32 storages () const noexcept=0
 Returns the number of structured and byte address buffer descriptors within the descriptor set. More...
 
virtual UInt32 images () const noexcept=0
 Returns the number of image (i.e. texture) descriptors within the descriptor set. More...
 
virtual UInt32 buffers () const noexcept=0
 Returns the number of texel buffer descriptors within the descriptor set. More...
 
virtual UInt32 samplers () const noexcept=0
 Returns the number of dynamic sampler descriptors within the descriptor set. More...
 
virtual UInt32 staticSamplers () const noexcept=0
 Returns the number of static or immutable sampler descriptors within the descriptor set. More...
 
virtual UInt32 inputAttachments () const noexcept=0
 Returns the number of input attachment descriptors within the descriptor set. More...
 
UniquePtr< IDescriptorSetallocate (const UInt32 &descriptors=0) const
 Allocates a new descriptor set or returns an instance of an unused descriptor set. More...
 
Array< UniquePtr< IDescriptorSet > > allocateMultiple (const UInt32 &descriptorSets, const UInt32 &descriptors=0) const
 Allocates an array of descriptor sets. More...
 
void free (const IDescriptorSet &descriptorSet) const noexcept
 Marks a descriptor set as unused, so that it can be handed out again instead of allocating a new one. More...
 

Detailed Description

template<typename TDescriptorLayout, typename TDescriptorSet>
requires rtti::implements<TDescriptorLayout, IDescriptorLayout> && rtti::implements<TDescriptorSet, DescriptorSet<typename TDescriptorSet::buffer_type, typename TDescriptorSet::image_type, typename TDescriptorSet::sampler_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()

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

Member Function Documentation

◆ allocate()

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

◆ allocateMultiple()

template<typename TDescriptorLayout , typename TDescriptorSet >
virtual Array< UniquePtr< descriptor_set_type > > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::allocateMultiple ( const UInt32 descriptorSets,
const UInt32 descriptors = 0 
) const
pure virtual

◆ descriptor()

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

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 Array< const descriptor_layout_type * > LiteFX::Rendering::DescriptorSetLayout< TDescriptorLayout, TDescriptorSet >::descriptors ( ) const
pure virtualnoexcept

◆ free()

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