Nebula
Loading...
Searching...
No Matches
CoreGraphics::ShaderIdentifier Class Reference

#include <shaderidentifier.h>

Detailed Description

The ShaderIdentifier is a zero-indexed registry which is used to identify shaders in a constant time (instead of using dictionaries) which can be used to select variables and whatnot using a FixedArray, which is guaranteed to retain the same index during the execution of the application.

Each shader resource will have its own shader identifier code, meaning we are limited to having MaxNumShaderIdentifiers different shader files before this class stops behaving (although this value can be increased if need be)

Public Types

typedef Util::StringAtom Name
 human readable name of a ModelNodeType
 
typedef IndexT Code
 binary code for a ModelNodeType
 

Static Public Member Functions

static Code FromName (const Name &name)
 convert from string
 
static Name ToName (Code c)
 convert to string
 

Static Public Attributes

static const IndexT MaxNumShaderIdentifiers = 128
 maximum number of different ModelNodeTypes
 
static const IndexT InvalidBatchType = InvalidIndex
 invalid model node type code
 

Private Member Functions

 ShaderIdentifier ()
 constructor
 

Private Attributes

Util::Dictionary< Name, IndexTnameToCode
 
Util::Array< NamecodeToName
 

Friends

class Base::ShaderServerBase
 

Member Typedef Documentation

◆ Code

binary code for a ModelNodeType

◆ Name

human readable name of a ModelNodeType

Constructor & Destructor Documentation

◆ ShaderIdentifier()

CoreGraphics::ShaderIdentifier::ShaderIdentifier ( )
private

constructor

Private constructor, only the ShaderServer may create the central ShaderIdentifier registry.

Member Function Documentation

◆ FromName()

ShaderIdentifier::Code CoreGraphics::ShaderIdentifier::FromName ( const Name & name)
static

convert from string

◆ ToName()

ShaderIdentifier::Name CoreGraphics::ShaderIdentifier::ToName ( Code c)
static

convert to string

Friends And Related Symbol Documentation

◆ Base::ShaderServerBase

friend class Base::ShaderServerBase
friend

Member Data Documentation

◆ codeToName

Util::Array<Name> CoreGraphics::ShaderIdentifier::codeToName
private

◆ InvalidBatchType

const IndexT CoreGraphics::ShaderIdentifier::InvalidBatchType = InvalidIndex
static

invalid model node type code

◆ MaxNumShaderIdentifiers

const IndexT CoreGraphics::ShaderIdentifier::MaxNumShaderIdentifiers = 128
static

maximum number of different ModelNodeTypes

◆ nameToCode

Util::Dictionary<Name, IndexT> CoreGraphics::ShaderIdentifier::nameToCode
private

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