00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef SHTRANSFORMER_HPP
00028 #define SHTRANSFORMER_HPP
00029
00030 #include "ShDllExport.hpp"
00031 #include "ShBackend.hpp"
00032 #include "ShProgram.hpp"
00033 #include "ShCtrlGraph.hpp"
00034 #include "ShInternals.hpp"
00035 #include "ShVariableType.hpp"
00036
00037 namespace SH {
00038
00052 class
00053 SH_DLLEXPORT ShTransformer {
00054 public:
00055 ShTransformer(const ShProgramNodePtr& program);
00056 ShTransformer::~ShTransformer();
00057 bool changed();
00058
00069 typedef std::vector<ShVariableNodePtr> VarNodeVec;
00070 typedef std::map<ShVariableNodePtr, VarNodeVec> VarSplitMap;
00071 friend struct VariableSplitter;
00072 friend struct StatementSplitter;
00073 void splitTuples(int maxTuple, VarSplitMap &splits);
00075
00085 friend struct InputOutputConvertor;
00086 void convertInputOutput();
00088
00094 void convertTextureLookups();
00096
00097
00107 void convertIntervalTypes(VarSplitMap &splits);
00108
00109
00110 typedef std::map<ShValueType, ShValueType> ValueTypeMap;
00121 void convertToFloat(ValueTypeMap &typeMap);
00122
00123
00124
00125
00126 private:
00128 ShTransformer(const ShTransformer& other);
00130 ShTransformer& operator=(const ShTransformer& other);
00131
00132 ShProgramNodePtr m_program;
00133 bool m_changed;
00134 };
00135
00136 }
00137
00138 #endif