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

Implements a DirectX 12 ShaderProgram. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::ShaderProgram< DirectX12ShaderModule >.

Classes

class  DirectX12ShaderProgramImpl
 

Public Member Functions

 DirectX12ShaderProgram (const DirectX12Device &device, Array< UniquePtr< DirectX12ShaderModule > > &&modules) noexcept
 Initializes a new DirectX 12 shader program. More...
 
 DirectX12ShaderProgram (DirectX12ShaderProgram &&) noexcept=delete
 
 DirectX12ShaderProgram (const DirectX12ShaderProgram &) noexcept=delete
 
virtual ~DirectX12ShaderProgram () noexcept
 
virtual Array< const DirectX12ShaderModule * > modules () const noexcept override
 
virtual SharedPtr< DirectX12PipelineLayoutreflectPipelineLayout () const
 
- Public Member Functions inherited from LiteFX::Rendering::ShaderProgram< DirectX12ShaderModule >
virtual ~ShaderProgram () noexcept=default
 
virtual Array< const shader_module_type * > modules () const noexcept=0
 
- Public Member Functions inherited from LiteFX::Rendering::IShaderProgram
virtual ~IShaderProgram () noexcept=default
 
Array< const IShaderModule * > modules () const noexcept
 Returns the modules, the shader program is build from. More...
 
SharedPtr< IPipelineLayoutreflectPipelineLayout () const
 Uses shader reflection to extract the pipeline layout of a shader. May not be available in all backends. More...
 

Static Public Member Functions

static void suppressMissingRootSignatureWarning (bool disableWarning=true) noexcept
 Suppresses the warning that is issued, if no root signature is found on a shader module when calling reflectPipelineLayout. More...
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::ShaderProgram< DirectX12ShaderModule >
using shader_module_type = DirectX12ShaderModule
 

Detailed Description

Implements a DirectX 12 ShaderProgram.

See also
DirectX12ShaderProgramBuilder

Constructor & Destructor Documentation

◆ DirectX12ShaderProgram() [1/3]

DirectX12ShaderProgram::DirectX12ShaderProgram ( const DirectX12Device device,
Array< UniquePtr< DirectX12ShaderModule > > &&  modules 
)
explicitnoexcept

Initializes a new DirectX 12 shader program.

Parameters
deviceThe parent device of the shader program.
modulesThe shader modules used by the shader program.

◆ DirectX12ShaderProgram() [2/3]

LiteFX::Rendering::Backends::DirectX12ShaderProgram::DirectX12ShaderProgram ( DirectX12ShaderProgram &&  )
deletenoexcept

◆ DirectX12ShaderProgram() [3/3]

LiteFX::Rendering::Backends::DirectX12ShaderProgram::DirectX12ShaderProgram ( const DirectX12ShaderProgram )
deletenoexcept

◆ ~DirectX12ShaderProgram()

DirectX12ShaderProgram::~DirectX12ShaderProgram ( )
virtualdefaultnoexcept

Member Function Documentation

◆ modules()

Array< const DirectX12ShaderModule * > DirectX12ShaderProgram::modules ( ) const
overridevirtualnoexcept

◆ reflectPipelineLayout()

SharedPtr< DirectX12PipelineLayout > DirectX12ShaderProgram::reflectPipelineLayout ( ) const
virtual

◆ suppressMissingRootSignatureWarning()

void DirectX12ShaderProgram::suppressMissingRootSignatureWarning ( bool  disableWarning = true)
staticnoexcept

Suppresses the warning that is issued, if no root signature is found on a shader module when calling reflectPipelineLayout.

When a shader program is asked to build a pipeline layout, it first checks if a root signature is provided within the shader bytecode. If no root signature could be found, it falls back to using plain reflection to extract the descriptor sets. This has the drawback, that some features are not or only partially supported. Most notably, it is not possible to reflect a pipeline layout that uses push constants this way. To ensure that you are not missing the root signature by accident, the engine warns you when it encounters this situation. However, if you are only using plain descriptor sets, this can result in noise warnings that clutter the log. You can call this function to disable the warnings explicitly.

Parameters
disableWarningtrue to stop issuing the warning or false to continue.
See also
reflectPipelineLayout