LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::Backends::DirectX12DescriptorSetLayout Class Reference

Implements a DirectX 12 DescriptorSetLayout. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::DescriptorSetLayout< DirectX12DescriptorLayout, DirectX12DescriptorSet >.

Classes

class  DirectX12DescriptorSetLayoutImpl
 

Public Member Functions

 DirectX12DescriptorSetLayout (const DirectX12Device &device, Array< UniquePtr< DirectX12DescriptorLayout > > &&descriptorLayouts, const UInt32 &space, const ShaderStage &stages)
 Initializes a DirectX 12 descriptor set layout. More...
 
 DirectX12DescriptorSetLayout (DirectX12DescriptorSetLayout &&)=delete
 
 DirectX12DescriptorSetLayout (const DirectX12DescriptorSetLayout &)=delete
 
virtual ~DirectX12DescriptorSetLayout () noexcept
 
virtual const UInt32rootParameterIndex () const noexcept
 Returns the index of the descriptor set root parameter. More...
 
virtual UInt32 descriptorOffsetForBinding (const UInt32 &binding) const
 Returns the index of the first descriptor for a certain binding. The offset is relative to the heap for the descriptor (i.e. sampler for sampler descriptors and CBV/SRV/UAV for other descriptors). More...
 
virtual const DirectX12Devicedevice () const noexcept
 Returns the parent device. More...
 
virtual Array< const DirectX12DescriptorLayout * > descriptors () const noexcept override
 
virtual const DirectX12DescriptorLayoutdescriptor (const UInt32 &binding) const override
 Returns the descriptor layout for the descriptor bound to the binding point provided with binding . More...
 
virtual const UInt32space () const noexcept override
 Returns the space index of the descriptor set. More...
 
virtual const ShaderStage & shaderStages () const noexcept override
 Returns the shader stages, the descriptor set is used in. More...
 
virtual UInt32 uniforms () const noexcept override
 Returns the number of uniform/constant buffer descriptors within the descriptor set. More...
 
virtual UInt32 storages () const noexcept override
 Returns the number of structured and byte address buffer descriptors within the descriptor set. More...
 
virtual UInt32 images () const noexcept override
 Returns the number of image (i.e. texture) descriptors within the descriptor set. More...
 
virtual UInt32 buffers () const noexcept override
 Returns the number of texel buffer descriptors within the descriptor set. More...
 
virtual UInt32 samplers () const noexcept override
 Returns the number of dynamic sampler descriptors within the descriptor set. More...
 
virtual UInt32 staticSamplers () const noexcept override
 Returns the number of static or immutable sampler descriptors within the descriptor set. More...
 
virtual UInt32 inputAttachments () const noexcept override
 Returns the number of input attachment descriptors within the descriptor set. More...
 
virtual UniquePtr< DirectX12DescriptorSetallocate (const UInt32 &descriptors=0) const override
 
virtual Array< UniquePtr< DirectX12DescriptorSet > > allocateMultiple (const UInt32 &descriptorSets, const UInt32 &descriptors=0) const override
 
virtual void free (const DirectX12DescriptorSet &descriptorSet) const noexcept override
 
- Public Member Functions inherited from LiteFX::Rendering::DescriptorSetLayout< DirectX12DescriptorLayout, DirectX12DescriptorSet >
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...
 

Protected Member Functions

virtual UInt32rootParameterIndex () noexcept
 Returns a reference of the index of the descriptor set root parameter. More...
 
virtual bool isRuntimeArray () const noexcept
 Returns true, if the descriptor set contains an (unbounded) runtime array. More...
 

Friends

class DirectX12PipelineLayout
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::DescriptorSetLayout< DirectX12DescriptorLayout, DirectX12DescriptorSet >
using descriptor_layout_type = DirectX12DescriptorLayout
 
using descriptor_set_type = DirectX12DescriptorSet
 

Detailed Description

Implements a DirectX 12 DescriptorSetLayout.

See also
DirectX12DescriptorSet, DirectX12PipelineDescriptorSetLayoutBuilder

Constructor & Destructor Documentation

◆ DirectX12DescriptorSetLayout() [1/3]

DirectX12DescriptorSetLayout::DirectX12DescriptorSetLayout ( const DirectX12Device device,
Array< UniquePtr< DirectX12DescriptorLayout > > &&  descriptorLayouts,
const UInt32 space,
const ShaderStage &  stages 
)
explicit

Initializes a DirectX 12 descriptor set layout.

Parameters
deviceThe device, the descriptor set layout is created on.
descriptorLayoutsThe descriptor layouts of the descriptors within the descriptor set.
spaceThe space or set id of the descriptor set.
stagesThe shader stages, the descriptor sets are bound to.

◆ DirectX12DescriptorSetLayout() [2/3]

LiteFX::Rendering::Backends::DirectX12DescriptorSetLayout::DirectX12DescriptorSetLayout ( DirectX12DescriptorSetLayout &&  )
delete

◆ DirectX12DescriptorSetLayout() [3/3]

LiteFX::Rendering::Backends::DirectX12DescriptorSetLayout::DirectX12DescriptorSetLayout ( const DirectX12DescriptorSetLayout )
delete

◆ ~DirectX12DescriptorSetLayout()

DirectX12DescriptorSetLayout::~DirectX12DescriptorSetLayout ( )
virtualdefaultnoexcept

Member Function Documentation

◆ allocate()

UniquePtr< DirectX12DescriptorSet > DirectX12DescriptorSetLayout::allocate ( const UInt32 descriptors = 0) const
overridevirtual

◆ allocateMultiple()

Array< UniquePtr< DirectX12DescriptorSet > > DirectX12DescriptorSetLayout::allocateMultiple ( const UInt32 descriptorSets,
const UInt32 descriptors = 0 
) const
overridevirtual

◆ buffers()

UInt32 DirectX12DescriptorSetLayout::buffers ( ) const
overridevirtualnoexcept

Returns the number of texel buffer descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ descriptor()

const DirectX12DescriptorLayout & DirectX12DescriptorSetLayout::descriptor ( const UInt32 binding) const
overridevirtual

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

Implements LiteFX::Rendering::DescriptorSetLayout< DirectX12DescriptorLayout, DirectX12DescriptorSet >.

◆ descriptorOffsetForBinding()

UInt32 DirectX12DescriptorSetLayout::descriptorOffsetForBinding ( const UInt32 binding) const
virtual

Returns the index of the first descriptor for a certain binding. The offset is relative to the heap for the descriptor (i.e. sampler for sampler descriptors and CBV/SRV/UAV for other descriptors).

Parameters
bindingThe binding of the descriptor.
Returns
The index of the first descriptor for the binding.
Exceptions
ArgumentOutOfRangeExceptionThrown, if the descriptor set does not contain a descriptor bound to the binding point specified by binding .

◆ descriptors()

Array< const DirectX12DescriptorLayout * > DirectX12DescriptorSetLayout::descriptors ( ) const
overridevirtualnoexcept

◆ device()

const DirectX12Device & DirectX12DescriptorSetLayout::device ( ) const
virtualnoexcept

Returns the parent device.

Returns
A reference of the parent device.

◆ free()

void DirectX12DescriptorSetLayout::free ( const DirectX12DescriptorSet descriptorSet) const
overridevirtualnoexcept

◆ images()

UInt32 DirectX12DescriptorSetLayout::images ( ) const
overridevirtualnoexcept

Returns the number of image (i.e. texture) descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ inputAttachments()

UInt32 DirectX12DescriptorSetLayout::inputAttachments ( ) const
overridevirtualnoexcept

Returns the number of input attachment descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ isRuntimeArray()

bool DirectX12DescriptorSetLayout::isRuntimeArray ( ) const
protectedvirtualnoexcept

Returns true, if the descriptor set contains an (unbounded) runtime array.

A descriptor set is a runtime array, if it contains exactly one descriptor, which is an unbounded array, i.e. which has a descriptor count of -1 (or 0xFFFFFFFF).

Returns
true, if the descriptor set contains an (unbounded) runtime array and false otherwise.

◆ rootParameterIndex() [1/2]

const UInt32 & DirectX12DescriptorSetLayout::rootParameterIndex ( ) const
virtualnoexcept

Returns the index of the descriptor set root parameter.

Returns
The index of the descriptor set root parameter.

◆ rootParameterIndex() [2/2]

UInt32 & DirectX12DescriptorSetLayout::rootParameterIndex ( )
protectedvirtualnoexcept

Returns a reference of the index of the descriptor set root parameter.

Returns
A reference of the index of the descriptor set root parameter.

◆ samplers()

UInt32 DirectX12DescriptorSetLayout::samplers ( ) const
overridevirtualnoexcept

Returns the number of dynamic sampler descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ shaderStages()

const ShaderStage & DirectX12DescriptorSetLayout::shaderStages ( ) const
overridevirtualnoexcept

Returns the shader stages, the descriptor set is used in.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ space()

const UInt32 & DirectX12DescriptorSetLayout::space ( ) const
overridevirtualnoexcept

Returns the space index of the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ staticSamplers()

UInt32 DirectX12DescriptorSetLayout::staticSamplers ( ) const
overridevirtualnoexcept

Returns the number of static or immutable sampler descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ storages()

UInt32 DirectX12DescriptorSetLayout::storages ( ) const
overridevirtualnoexcept

Returns the number of structured and byte address buffer descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

◆ uniforms()

UInt32 DirectX12DescriptorSetLayout::uniforms ( ) const
overridevirtualnoexcept

Returns the number of uniform/constant buffer descriptors within the descriptor set.

Implements LiteFX::Rendering::IDescriptorSetLayout.

Friends And Related Function Documentation

◆ DirectX12PipelineLayout

friend class DirectX12PipelineLayout
friend