27#ifndef _ShaderFunctionAtom_
28#define _ShaderFunctionAtom_
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.
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.
vector< Operand >::type OperandVector
const String & getReturnType() const
Return the return type.
static String Type
The type of this class.
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.
~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.
@ OPS_INOUT
The parameter is a input/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
SharedPtr< Parameter > ParameterPtr
FunctionAtomInstanceList::const_iterator FunctionAtomInstanceConstIterator
GeneralAllocatedObject RTShaderSystemAlloc
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