OGRE  1.10.12
Object-Oriented Graphics Rendering Engine
Ogre::GpuNamedConstants Struct Reference

Struct collecting together the information for named constants. More...

#include <OgreGpuProgramParams.h>

+ Inheritance diagram for Ogre::GpuNamedConstants:

Public Member Functions

 GpuNamedConstants ()
 
size_t calculateSize (void) const
 
void generateConstantDefinitionArrayEntries (const String &paramName, const GpuConstantDefinition &baseDef)
 Generate additional constant entries for arrays based on a base definition. More...
 
void load (DataStreamPtr &stream)
 Loads constant definitions from a stream, compatible with GpuProgram::setManualNamedConstantsFile. More...
 
void save (const String &filename) const
 Saves constant definitions to a file, compatible with GpuProgram::setManualNamedConstantsFile. More...
 

Static Public Member Functions

static bool getGenerateAllConstantDefinitionArrayEntries ()
 Indicates whether all array entries will be generated and added to the definitions map. More...
 
static void setGenerateAllConstantDefinitionArrayEntries (bool generateAll)
 Sets whether all array entries will be generated and added to the definitions map. More...
 

Public Attributes

size_t doubleBufferSize
 Total size of the double buffer required. More...
 
size_t floatBufferSize
 Total size of the float buffer required. More...
 
size_t intBufferSize
 Total size of the int buffer required. More...
 
GpuConstantDefinitionMap map
 Total size of the bool buffer required. More...
 
size_t uintBufferSize
 Total size of the uint buffer required. More...
 

Detailed Description

Struct collecting together the information for named constants.

Constructor & Destructor Documentation

◆ GpuNamedConstants()

Ogre::GpuNamedConstants::GpuNamedConstants ( )
inline

Member Function Documentation

◆ generateConstantDefinitionArrayEntries()

void Ogre::GpuNamedConstants::generateConstantDefinitionArrayEntries ( const String paramName,
const GpuConstantDefinition baseDef 
)

Generate additional constant entries for arrays based on a base definition.

Remarks
Array uniforms will be added just with their base name with no array suffix. This method will add named entries for array suffixes too so individual array entries can be addressed. Note that we only individually index array elements if the array size is up to 16 entries in size. Anything larger than that only gets a [0] entry as well as the main entry, to save cluttering up the name map. After all, you can address the larger arrays in a bulk fashion much more easily anyway.

◆ getGenerateAllConstantDefinitionArrayEntries()

static bool Ogre::GpuNamedConstants::getGenerateAllConstantDefinitionArrayEntries ( )
static

Indicates whether all array entries will be generated and added to the definitions map.

◆ setGenerateAllConstantDefinitionArrayEntries()

static void Ogre::GpuNamedConstants::setGenerateAllConstantDefinitionArrayEntries ( bool  generateAll)
static

Sets whether all array entries will be generated and added to the definitions map.

Remarks
Usually, array entries can only be individually indexed if they're up to 16 entries long, to save memory - arrays larger than that can be set but only via the bulk setting methods. This option allows you to choose to individually index every array entry.

◆ save()

void Ogre::GpuNamedConstants::save ( const String filename) const

Saves constant definitions to a file, compatible with GpuProgram::setManualNamedConstantsFile.

See also
GpuProgram::setManualNamedConstantsFile

◆ load()

void Ogre::GpuNamedConstants::load ( DataStreamPtr stream)

Loads constant definitions from a stream, compatible with GpuProgram::setManualNamedConstantsFile.

See also
GpuProgram::setManualNamedConstantsFile

◆ calculateSize()

size_t Ogre::GpuNamedConstants::calculateSize ( void  ) const

Member Data Documentation

◆ floatBufferSize

size_t Ogre::GpuNamedConstants::floatBufferSize

Total size of the float buffer required.

◆ doubleBufferSize

size_t Ogre::GpuNamedConstants::doubleBufferSize

Total size of the double buffer required.

◆ intBufferSize

size_t Ogre::GpuNamedConstants::intBufferSize

Total size of the int buffer required.

◆ uintBufferSize

size_t Ogre::GpuNamedConstants::uintBufferSize

Total size of the uint buffer required.

◆ map

GpuConstantDefinitionMap Ogre::GpuNamedConstants::map

Total size of the bool buffer required.

Map of parameter names to GpuConstantDefinition


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