Nameless Engine
Loading...
Searching...
No Matches
ne::Pipeline::ShaderConstantsData Struct Reference

#include <Pipeline.h>

Public Member Functions

void findOffsetAndCopySpecialValueToConstant (Pipeline *pPipeline, const char *pConstantName, unsigned int iValueToCopy)
 

Public Attributes

std::unique_ptr< PipelineShaderConstantsManagerpConstantsManager
 
std::unordered_map< std::string, size_t > uintConstantsOffsets
 

Detailed Description

Groups information related to push/root constants.

Member Function Documentation

◆ findOffsetAndCopySpecialValueToConstant()

void ne::Pipeline::ShaderConstantsData::findOffsetAndCopySpecialValueToConstant ( Pipeline pPipeline,
const char *  pConstantName,
unsigned int  iValueToCopy 
)

Looks for and index of the specified shader constant in the specified pipeline and copies the specified value into the constant's slot.

Warning
In debug builds shows an error and throws an exception if the specified constant is not used in the pipeline, otherwise in release builds does not check this and will probably crash if the specified constant is not used.
Remarks
Named "special" because this function is generally used for special shader constants (not used-defined).
Parameters
pPipelinePipeline to look for offset of the constant.
pConstantNameName of the constant from shader code.
iValueToCopyValue to copy as constant.

Member Data Documentation

◆ pConstantsManager

std::unique_ptr<PipelineShaderConstantsManager> ne::Pipeline::ShaderConstantsData::pConstantsManager

Stores push constants. nullptr if push/root constants are not used.

◆ uintConstantsOffsets

std::unordered_map<std::string, size_t> ne::Pipeline::ShaderConstantsData::uintConstantsOffsets

Stores names of fields defined in GLSL as push constants or as root constants in HLSL (all with uint type) and offset of the constant from the beginning of the layout/struct.


The documentation for this struct was generated from the following files: