27 #ifndef _ShaderProgramProcessor_
28 #define _ShaderProgramProcessor_
63 virtual const String& getTargetLanguage()
const = 0;
70 virtual bool preCreateGpuPrograms(
ProgramSet* programSet) = 0;
76 virtual bool postCreateGpuPrograms(
ProgramSet* programSet) = 0;
95 void addSourceParameter(
ParameterPtr srcParam,
int mask);
110 int getUsedFloatCount();
113 ParameterPtr getDestinationParameter(
int usage,
int index);
118 void createDestinationParameter(
int usage,
int index);
127 int mSrcParameterMask[4];
129 int mDstParameterMask[4];
143 size_t srcParameterTypeCount[4];
145 int srcParameterMask[4];
148 int float1Count,
int float1Mask,
149 int float2Count,
int float2Mask,
150 int float3Count,
int float3Mask,
151 int float4Count,
int float4Mask)
153 srcParameterTypeCount[0] = float1Count;
154 srcParameterTypeCount[1] = float2Count;
155 srcParameterTypeCount[2] = float3Count;
156 srcParameterTypeCount[3] = float4Count;
157 srcParameterMask[0] = float1Mask;
158 srcParameterMask[1] = float2Mask;
159 srcParameterMask[2] = float3Mask;
160 srcParameterMask[3] = float4Mask;
174 void buildMergeCombinations();
188 void countVsTexcoordOutputs(
Function* vsMain,
int& outTexCoordSlots,
int& outTexCoordFloats);
208 void mergeParametersByPredefinedCombinations(
ShaderParameterList paramsTable[4], MergeParameterList& mergedParams);
231 void rebuildParameterList(
Function* func,
int paramsUsage, MergeParameterList& mergedParams);
234 void rebuildFunctionInvocations(
FunctionAtomInstanceList& funcAtomList, MergeParameterList& mergedParams, LocalParameterMap& localParamsMap);
240 void replaceParametersReferences(MergeParameterList& mergedParams, ParameterOperandMap& paramsRefMap);
243 void replaceSplitParametersReferences(LocalParameterMap& localParamsMap, ParameterOperandMap& paramsRefMap);
252 static int getParameterMaskByFloatCount(
int floatCount);
size_t getSourceParameterCount() const
Return the source parameter count.
MergeCombinationList mParamMergeCombinations
vector< MergeCombination >::type MergeCombinationList
int getSourceParameterMask(unsigned int index) const
Return source parameter mask by index.
vector< MergeParameter >::type MergeParameterList
ParameterPtr mDstParameter
vector< ParameterPtr >::type ShaderParameterList
Container class for shader based programs.
std::map< K, V, P, A > type
map< Parameter *, OperandPtrVector >::type ParameterOperandMap
size_t mSrcParameterCount
A class that represents a shader based program.
int getDestinationParameterMask(unsigned int index) const
Return destination parameter mask by index.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
MergeCombination(int float1Count, int float1Mask, int float2Count, int float2Mask, int float3Count, int float3Mask, int float4Count, int float4Mask)
A class that provides extra processing services on CPU based programs.
A class that represents a shader based program function.
vector< Operand * >::type OperandPtrVector
GpuConstantType
Enumeration of the types of constant we may encounter in programs.
map< Parameter *, ParameterPtr >::type LocalParameterMap
map< Function *, String * >::type mFunctionMap
ParameterPtr getSourceParameter(unsigned int index)
Return source parameter by index.
vector< FunctionAtom * >::type FunctionAtomInstanceList
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...