HDK
|
#include <ShaderStage.h>
Public Member Functions | |
VariableBlock (const string &name, const string &instance) | |
const string & | getName () const |
Get the name of this block. More... | |
void | setName (const string &name) |
Set the name of this block. More... | |
const string & | getInstance () const |
Get the instance name of this block. More... | |
void | setInstance (const string &instance) |
Set the instance name of this block. More... | |
bool | empty () const |
Return true if the block has no variables. More... | |
size_t | size () const |
Return the number of variables in this block. More... | |
ShaderPort * | operator[] (size_t index) |
Return a variable by index. More... | |
const ShaderPort * | operator[] (size_t index) const |
Return a variable by index. More... | |
const vector< ShaderPort * > & | getVariableOrder () const |
Return a const reference to our variable order vector. More... | |
ShaderPort * | operator[] (const string &name) |
const ShaderPort * | operator[] (const string &name) const |
ShaderPort * | find (const string &name) |
const ShaderPort * | find (const string &name) const |
ShaderPort * | find (const ShaderPortPredicate &predicate) |
Find a port based on a predicate. More... | |
ShaderPort * | add (const TypeDesc *type, const string &name, ValuePtr value=nullptr, bool shouldWiden=false) |
void | add (ShaderPortPtr port) |
Add an existing shader port to this block. More... | |
A block of variables in a shader stage
Definition at line 60 of file ShaderStage.h.
Definition at line 63 of file ShaderStage.h.
ShaderPort* VariableBlock::add | ( | const TypeDesc * | type, |
const string & | name, | ||
ValuePtr | value = nullptr , |
||
bool | shouldWiden = false |
||
) |
Add a new shader port to this block.
type | The desired shader port type |
name | The shader port name |
value | The value to attach to the shader port |
shouldWiden | When false, an exception is thrown if the type of the existing port with the same name does not match the requested type. When true, the types can mismatch, and the type of any existing port is widened to match the requested type when necessary. |
void VariableBlock::add | ( | ShaderPortPtr | port | ) |
Add an existing shader port to this block.
|
inline |
Return true if the block has no variables.
Definition at line 82 of file ShaderStage.h.
ShaderPort* VariableBlock::find | ( | const string & | name | ) |
Return a variable by name. Returns nullptr if no variable is found by the given name.
const ShaderPort* VariableBlock::find | ( | const string & | name | ) | const |
Return a variable by name. Returns nullptr if no variable is found by the given name.
ShaderPort* VariableBlock::find | ( | const ShaderPortPredicate & | predicate | ) |
Find a port based on a predicate.
|
inline |
Get the instance name of this block.
Definition at line 76 of file ShaderStage.h.
|
inline |
Get the name of this block.
Definition at line 70 of file ShaderStage.h.
|
inline |
Return a const reference to our variable order vector.
Definition at line 94 of file ShaderStage.h.
|
inline |
Return a variable by index.
Definition at line 88 of file ShaderStage.h.
|
inline |
Return a variable by index.
Definition at line 91 of file ShaderStage.h.
ShaderPort* VariableBlock::operator[] | ( | const string & | name | ) |
Return a variable by name. Throws exception if no variable is found by the given name.
const ShaderPort* VariableBlock::operator[] | ( | const string & | name | ) | const |
Return a variable by name. Throws exception if no variable is found by the given name.
Set the instance name of this block.
Definition at line 79 of file ShaderStage.h.
Set the name of this block.
Definition at line 73 of file ShaderStage.h.
|
inline |
Return the number of variables in this block.
Definition at line 85 of file ShaderStage.h.