#include <ShVariable.hpp>
Inheritance diagram for SH::ShVariable:
Public Member Functions | |
ShVariable (const ShVariableNodePtr &node) | |
ShVariable (const ShVariableNodePtr &node, const ShSwizzle &swizzle, bool neg) | |
ShVariable & | operator= (const ShProgram &prg) |
bool | null () const |
true iff node is a null pointer. | |
bool | uniform () const |
Is this a uniform (non-shader specific) variable? | |
bool | hasValues () const |
Does this variable have constant (host-local) values? | |
int | size () const |
Get the number of elements in this variable, after swizzling. | |
ShValueType | valueType () const |
Returns index of the data type held in this node, or 0 if no node. | |
const ShSwizzle & | swizzle () const |
Obtain the swizzling (if any) applied to this variable. | |
const ShVariableNodePtr & | node () const |
Obtain the actual node this variable refers to. | |
bool | neg () const |
Return true if this variable is negated. | |
bool & | neg () |
ShVariantPtr | getVariant () const |
Returns a copy of the variant (with swizzling & proper negation). | |
ShVariantPtr | getVariant (int index) const |
bool | loadVariant (ShVariant *&result) const |
Sets result to this' variant if possible. | |
void | updateVariant () |
void | setVariant (const ShVariant *other, bool neg, const ShSwizzle &writemask) |
Sets the elements of this variant from other accounting for this' writemask and negations. | |
void | setVariant (ShVariantCPtr other, bool neg, const ShSwizzle &writemask) |
void | setVariant (const ShVariant *other, int index) |
Sets the indicated element of this' variant from other. | |
void | setVariant (ShVariantCPtr other, int index) |
void | setVariant (const ShVariant *other) |
Sets this' variant from the contents of other. | |
void | setVariant (ShVariantCPtr other) |
ShVariable | operator() () const |
Identity swizzle. | |
ShVariable | operator() (int) const |
ShVariable | operator() (int, int) const |
ShVariable | operator() (int, int, int) const |
ShVariable | operator() (int, int, int, int) const |
ShVariable | operator() (int size, int indices[]) const |
ShVariable | operator- () const |
bool | operator== (const ShVariable &other) const |
bool | operator!= (const ShVariable &other) const |
void | clone (const ShVariable &other) |
Metadata | |
void | rangeVariant (const ShVariant *low, const ShVariant *high) |
Set a range of values for this variable. | |
Metadata | |
This data is useful for various things, including asset management. | |
ShVariantPtr | lowBoundVariant () const |
ShVariantPtr | highBoundVariant () const |
Obtain an upper bounds on this variable (tuple of same size as this). | |
Protected Attributes | |
ShVariableNodePtr | m_node |
The actual variable node we refer to. | |
ShSwizzle | m_swizzle |
Swizzling applied to this variable. | |
bool | m_neg |
True iff this variable is negated. | |
Friends | |
SH_DLLEXPORT std::ostream & | operator<< (std::ostream &out, const ShVariable &shVariableToPrint) |
Note: subclasses should not keep any additional data. All data relevant to the node should be stored in m_node. This is due to instances of subclasses of ShVariable being sliced when they get placed in ShStatements.
Definition at line 48 of file ShVariable.hpp.
|
Sets result to this' variant if possible. Otherwise, if swizzling or negation are required, then makes a copy into result.
Definition at line 137 of file ShVariable.cpp. References getVariant(), SH::ShSwizzle::identity(), m_neg, m_node, m_swizzle, and SH::ShPointer< T >::object(). |