#include "../Include/Common.h"
#include "../Include/ShHandle.h"
+#include "../MachineIndependent/Versions.h"
//
// Here is where real machine specific high-level data would be defined.
class TGenericCompiler : public TCompiler {
public:
TGenericCompiler(EShLanguage l, int dOptions) : TCompiler(l, infoSink), debugOptions(dOptions) { }
- virtual bool compile(TIntermNode* root);
+ virtual bool compile(TIntermNode* root, int version = 0, EProfile profile = ENoProfile);
TInfoSink infoSink;
int debugOptions;
};
//
// Generate code from the given parse tree
//
-bool TGenericCompiler::compile(TIntermNode *root)
+bool TGenericCompiler::compile(TIntermNode *root, int version, EProfile profile)
{
haveValidObjectCode = true;
#define SH_EXPORTING
#include "../Public/ShaderLang.h"
-
+#include "../MachineIndependent/Versions.h"
#include "InfoSink.h"
class TCompiler;
EShLanguage getLanguage() { return language; }
virtual TInfoSink& getInfoSink() { return infoSink; }
- virtual bool compile(TIntermNode* root) = 0;
+ virtual bool compile(TIntermNode* root, int version = 0, EProfile profile = ENoProfile) = 0;
virtual TCompiler* getAsCompiler() { return this; }
virtual bool linkable() { return haveValidObjectCode; }
//
// Call the machine dependent compiler
//
- if (! compiler->compile(parseContext.treeRoot))
+ if (! compiler->compile(parseContext.treeRoot, parseContext.version, parseContext.profile))
success = false;
}
}