Nameless Engine
Loading...
Searching...
No Matches
ne::PipelineShaderConstantsManager Class Reference

#include <PipelineShaderConstantsManager.hpp>

Classes

struct  SpecialConstantsNames
 

Public Types

using variable_type = unsigned int
 

Public Member Functions

 PipelineShaderConstantsManager (const PipelineShaderConstantsManager &)=delete
 
PipelineShaderConstantsManageroperator= (const PipelineShaderConstantsManager &)=delete
 
 PipelineShaderConstantsManager (size_t iVariableCount)
 
void copyValueToShaderConstant (size_t iShaderConstantIndex, unsigned int iValueToCopy)
 
unsigned int getTotalSizeInBytes () const
 
unsigned int getVariableCount () const
 
void * getData ()
 

Static Public Member Functions

static constexpr size_t getMaxConstantsSizeInBytes ()
 

Private Attributes

std::vector< variable_typevConstantsData
 

Static Private Attributes

static constexpr size_t iMaxShaderConstantsSizeInBytes
 

Detailed Description

Stores data to copy to push constants (Vulkan) or root constants (DirectX).

Member Typedef Documentation

◆ variable_type

Type of the variables the manager stores.

Constructor & Destructor Documentation

◆ PipelineShaderConstantsManager()

ne::PipelineShaderConstantsManager::PipelineShaderConstantsManager ( size_t  iVariableCount)
inline

Creates a new manager that stores the specified number of unsigned int variables as push/root constants.

Warning
Shows an error and throws an exception if the specified size (in bytes not in unsigned ints) will exceed getMaxConstantsSizeInBytes.
Parameters
iVariableCountDefines how much unsigned ints to store as push/root constants.

Member Function Documentation

◆ copyValueToShaderConstant()

void ne::PipelineShaderConstantsManager::copyValueToShaderConstant ( size_t  iShaderConstantIndex,
unsigned int  iValueToCopy 
)
inline

Copies the specified value into the specified push/root constant.

Parameters
iShaderConstantIndexIndex of the push/root constant to copy the data to.
iValueToCopyValue to copy.

◆ getData()

void * ne::PipelineShaderConstantsManager::getData ( )
inline

Returns pointer to the beginning of the push/root constants data.

Returns
Push/root constants data.

◆ getMaxConstantsSizeInBytes()

static constexpr size_t ne::PipelineShaderConstantsManager::getMaxConstantsSizeInBytes ( )
inlinestaticconstexpr

Returns the maximum size of constants data that the manager allows to have.

Returns
Maximum size of constants in bytes.

◆ getTotalSizeInBytes()

unsigned int ne::PipelineShaderConstantsManager::getTotalSizeInBytes ( ) const
inline

Returns total size of push/root constants data in bytes.

Returns
Size in bytes. Returning unsigned int since Vulkan and DirectX operate on uints.

◆ getVariableCount()

unsigned int ne::PipelineShaderConstantsManager::getVariableCount ( ) const
inline

Returns the total number of unsigned ints stored as push/root constants.

Returns
Number of variables.

Member Data Documentation

◆ iMaxShaderConstantsSizeInBytes

constexpr size_t ne::PipelineShaderConstantsManager::iMaxShaderConstantsSizeInBytes
staticconstexprprivate
Initial value:
=
128

Defines the maximum size of constants in total (in bytes).

◆ vConstantsData

std::vector<variable_type> ne::PipelineShaderConstantsManager::vConstantsData
private

Data that will be copied to push/root constants.


The documentation for this class was generated from the following file: