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))); }
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A class that represents an atomic code section of shader based program function.
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.
FunctionAtom()
Class default constructor.
int mInternalExecutionOrder
int getInternalExecutionOrder() const
Get an internal execution order within a group of this function atom.
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.
virtual ~FunctionAtom()
Class default destructor.
A class that represents function invocation code from shader based program function.
OperandVector & getOperandList()
Get a list of parameters this function invocation will use in the function call as arguments.
virtual const String & getFunctionAtomType()
virtual void writeSourceCode(std::ostream &os, const String &targetLanguage) const
FunctionInvocation(const String &functionName, int groupOrder, int internalOrder, String returnType="void")
Class constructor.
const String & getReturnType() const
Return the return type.
static String Type
The type of this class.
vector< Operand >::type OperandVector
FunctionInvocation(const FunctionInvocation &rhs)
Copy constructor.
const String & getFunctionName() const
Return the function name.
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.
A class that represents a function operand (its the combination of a parameter the in/out semantic an...
~Operand()
Class destructor.
static GpuConstantType getGpuConstantType(int mask)
Return the gpu constant type of the given mask.
static int getFloatCount(int mask)
Return the float count of the given mask.
ushort mIndirectionLevel
The level of indirection.
OpSemantic mSemantic
Tells if the parameter is of type input,output or both.
int getMask() const
Returns the mask bitfield.
@ OPS_IN
The parameter is a input parameter.
@ OPS_OUT
The parameter is a output parameter.
OpSemantic getSemantic() const
Returns the operand semantic (do we read/write or both with the parameter).
ushort getIndirectionLevel() const
Returns the level of indirection.
Operand(const Operand &rhs)
Copy constructor.
const ParameterPtr & getParameter() const
Returns the parameter object as weak reference.
bool hasFreeFields() const
Returns true if not all fields used.
String toString() const
Returns the parameter name and the usage mask like this 'color.xyz'.
Operand(ParameterPtr parameter, Operand::OpSemantic opSemantic, int opMask=Operand::OPM_ALL, ushort indirectionLevel=0)
Class constructor.
int mMask
Which part of the parameter should be passed (x,y,z,w)
ParameterPtr mParameter
The parameter being carried by the operand.
static String getMaskAsString(int mask)
Returns the given mask as string representation.
GpuConstantType
Enumeration of the types of constant we may encounter in programs.
vector< FunctionAtom * >::type FunctionAtomInstanceList
FunctionAtomInstanceList::iterator FunctionAtomInstanceIterator
FunctionAtomInstanceList::const_iterator FunctionAtomInstanceConstIterator
Comparator function to be used for comparisons.
bool operator()(FunctionInvocation const &lhs, FunctionInvocation const &rhs) const
Comparator function to be used for sorting.
bool operator()(FunctionInvocation const &lhs, FunctionInvocation const &rhs) const