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

Implements the DirectX 12 PushConstantsLayout. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::PushConstantsLayout< DirectX12PushConstantsRange >.

Classes

class  DirectX12PushConstantsLayoutImpl
 

Public Member Functions

 DirectX12PushConstantsLayout (Array< UniquePtr< DirectX12PushConstantsRange > > &&ranges, const UInt32 &size)
 Initializes a new push constants layout. More...
 
 DirectX12PushConstantsLayout (const DirectX12PushConstantsLayout &)=delete
 
 DirectX12PushConstantsLayout (DirectX12PushConstantsLayout &&)=delete
 
virtual ~DirectX12PushConstantsLayout () noexcept
 
virtual const UInt32size () const noexcept override
 Returns the size (in bytes) of the push constants backing memory. More...
 
virtual const DirectX12PushConstantsRangerange (const ShaderStage &stage) const override
 Returns the push constant range associated with the shader stage provided in stage . More...
 
virtual Array< const DirectX12PushConstantsRange * > ranges () const noexcept override
 
- Public Member Functions inherited from LiteFX::Rendering::PushConstantsLayout< DirectX12PushConstantsRange >
virtual ~PushConstantsLayout () noexcept=default
 
virtual Array< const push_constants_range_type * > ranges () const noexcept=0
 
- Public Member Functions inherited from LiteFX::Rendering::IPushConstantsLayout
virtual ~IPushConstantsLayout () noexcept=default
 
virtual const UInt32size () const noexcept=0
 Returns the size (in bytes) of the push constants backing memory. More...
 
virtual const IPushConstantsRangerange (const ShaderStage &stage) const =0
 Returns the push constant range associated with the shader stage provided in stage . More...
 
Array< const IPushConstantsRange * > ranges () const noexcept
 Returns all push constant ranges. More...
 

Protected Member Functions

virtual Array< DirectX12PushConstantsRange * > ranges () noexcept
 Returns an array of pointers to the push constant ranges of the layout. More...
 

Friends

class DirectX12PipelineLayout
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::PushConstantsLayout< DirectX12PushConstantsRange >
using push_constants_range_type = DirectX12PushConstantsRange
 

Detailed Description

Implements the DirectX 12 PushConstantsLayout.

In DirectX 12, push constants map to root constants. Those are 32 bit values that are directly stored on the root signature. Thus, push constants can bloat your root signature, since all the required memory is directly reserved on it. The way they are implemented is, that each range gets directly written in 4 byte chunks into the command buffer. Thus, overlapping is not directly supported (as opposed to Vulkan). If you have overlapping push constants ranges, the overlap will be duplicated in the root signature.

See also
DirectX12PushConstantsRange, DirectX12PipelinePushConstantsLayoutBuilder

Constructor & Destructor Documentation

◆ DirectX12PushConstantsLayout() [1/3]

DirectX12PushConstantsLayout::DirectX12PushConstantsLayout ( Array< UniquePtr< DirectX12PushConstantsRange > > &&  ranges,
const UInt32 size 
)
explicit

Initializes a new push constants layout.

Parameters
rangesThe ranges contained by the layout.
sizeThe overall size (in bytes) of the push constants backing memory.

◆ DirectX12PushConstantsLayout() [2/3]

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

◆ DirectX12PushConstantsLayout() [3/3]

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

◆ ~DirectX12PushConstantsLayout()

DirectX12PushConstantsLayout::~DirectX12PushConstantsLayout ( )
virtualdefaultnoexcept

Member Function Documentation

◆ range()

const DirectX12PushConstantsRange & DirectX12PushConstantsLayout::range ( const ShaderStage &  stage) const
overridevirtual

Returns the push constant range associated with the shader stage provided in stage .

Implements LiteFX::Rendering::IPushConstantsLayout.

◆ ranges() [1/2]

Array< const DirectX12PushConstantsRange * > DirectX12PushConstantsLayout::ranges ( ) const
overridevirtualnoexcept

◆ ranges() [2/2]

Array< DirectX12PushConstantsRange * > DirectX12PushConstantsLayout::ranges ( )
protectedvirtualnoexcept

Returns an array of pointers to the push constant ranges of the layout.

Returns
An array of pointers to the push constant ranges of the layout.

◆ size()

const UInt32 & DirectX12PushConstantsLayout::size ( ) const
overridevirtualnoexcept

Returns the size (in bytes) of the push constants backing memory.

Implements LiteFX::Rendering::IPushConstantsLayout.

Friends And Related Function Documentation

◆ DirectX12PipelineLayout

friend class DirectX12PipelineLayout
friend