Go to the documentation of this file.
27 #ifndef _ShaderFunctionAtom_
28 #define _ShaderFunctionAtom_
103 OPM_XY = OPM_X | OPM_Y,
104 OPM_XZ = OPM_X | OPM_Z,
105 OPM_XW = OPM_X | OPM_W,
106 OPM_YZ = OPM_Y | OPM_Z,
107 OPM_YW = OPM_Y | OPM_W,
108 OPM_ZW = OPM_Z | OPM_W,
109 OPM_XYZ = OPM_X | OPM_Y | OPM_Z,
110 OPM_XYW = OPM_X | OPM_Y | OPM_W,
111 OPM_XZW = OPM_X | OPM_Z | OPM_W,
112 OPM_YZW = OPM_Y | OPM_Z | OPM_W,
113 OPM_XYZW = OPM_X | OPM_Y | OPM_Z | OPM_W
138 bool hasFreeFields()
const {
return ((mMask & ~OPM_ALL) && ((mMask & ~OPM_X) || (mMask & ~OPM_Y) || (mMask & ~OPM_Z) || (mMask & ~OPM_W))); }
Comparator function to be used for sorting.
static int getFloatCount(int mask)
Return the float count of the given mask.
Comparator function to be used for comparisons.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual const String & getFunctionAtomType()
vector< Operand >::type OperandVector
~Operand()
Class destructor.
const String & getFunctionName() const
Return the function name.
virtual void writeSourceCode(std::ostream &os, const String &targetLanguage) const
virtual ~FunctionAtom()
Class default destructor.
OpSemantic mSemantic
Tells if the parameter is of type input,output or both.
String toString() const
Returns the parameter name and the usage mask like this 'color.xyz'.
virtual const String & getFunctionAtomType()=0
Return the type of this atom instance implementation.
int getGroupExecutionOrder() const
Get the group execution order of this function atom.
ushort mIndirectionLevel
The level of indirection.
const String & getReturnType() const
Return the return type.
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
FunctionAtomInstanceList::const_iterator FunctionAtomInstanceConstIterator
ParameterPtr mParameter
The parameter being carried by the operand.
static GpuConstantType getGpuConstantType(int mask)
Return the gpu constant type of the given mask.
Operand(const Operand &rhs)
Copy constructor.
OpSemantic getSemantic() const
Returns the operand semantic (do we read/write or both with the parameter).
bool hasFreeFields() const
Returns true if not all fields used.
A class that represents an atomic code section of shader based program function.
int getInternalExecutionOrder() const
Get an internal execution order within a group of this function atom.
FunctionInvocation(const FunctionInvocation &rhs)
Copy constructor.
void pushOperand(ParameterPtr parameter, Operand::OpSemantic opSemantic, int opMask=Operand::OPM_ALL, int indirectionLevel=0)
Push a new operand (on the end) to the function.
const ParameterPtr & getParameter() const
Returns the parameter object as weak reference.
int mMask
Which part of the parameter should be passed (x,y,z,w)
@ OPS_IN
The parameter is a input parameter.
A class that represents function invocation code from shader based program function.
int mInternalExecutionOrder
OperandVector & getOperandList()
Get a list of parameters this function invocation will use in the function call as arguments.
GpuConstantType
Enumeration of the types of constant we may encounter in programs.
virtual void writeSourceCode(std::ostream &os, const String &targetLanguage) const =0
Abstract method that writes a source code to the given output stream in the target shader language.
A class that represents a function operand (its the combination of a parameter the in/out semantic an...
static String getMaskAsString(int mask)
Returns the given mask as string representation.
FunctionAtom()
Class default constructor.
FunctionAtomInstanceList::iterator FunctionAtomInstanceIterator
FunctionInvocation(const String &functionName, int groupOrder, int internalOrder, String returnType="void")
Class constructor.
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
ushort getIndirectionLevel() const
Returns the level of indirection.
vector< FunctionAtom * >::type FunctionAtomInstanceList
bool operator<(SharedPtr< T > const &a, SharedPtr< U > const &b)
bool operator()(FunctionInvocation const &lhs, FunctionInvocation const &rhs) const
static String Type
The type of this class.
int getMask() const
Returns the mask bitfield.
Operand(ParameterPtr parameter, Operand::OpSemantic opSemantic, int opMask=Operand::OPM_ALL, ushort indirectionLevel=0)
Class constructor.
bool operator()(FunctionInvocation const &lhs, FunctionInvocation const &rhs) const
@ OPS_OUT
The parameter is a output parameter.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.