Add and use ability to tell the backend compiler what version/profile the source...
authorJohn Kessenich <cepheus@frii.com>
Tue, 12 Mar 2013 17:53:55 +0000 (17:53 +0000)
committerJohn Kessenich <cepheus@frii.com>
Tue, 12 Mar 2013 17:53:55 +0000 (17:53 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20840 e7fa87d3-cd2b-0410-9028-fcbf551c1848

glslang/GenericCodeGen/CodeGen.cpp
glslang/Include/ShHandle.h
glslang/MachineIndependent/ShaderLang.cpp

index 89394ba..7628c49 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "../Include/Common.h"
 #include "../Include/ShHandle.h"
+#include "../MachineIndependent/Versions.h"
 
 //
 // Here is where real machine specific high-level data would be defined.
@@ -41,7 +42,7 @@
 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;
 };
@@ -67,7 +68,7 @@ void DeleteCompiler(TCompiler* compiler)
 //
 //  Generate code from the given parse tree
 //
-bool TGenericCompiler::compile(TIntermNode *root)
+bool TGenericCompiler::compile(TIntermNode *root, int version, EProfile profile)
 {
     haveValidObjectCode = true;
 
index 0bde67b..3a8420a 100644 (file)
@@ -45,7 +45,7 @@
 
 #define SH_EXPORTING   
 #include "../Public/ShaderLang.h"
-
+#include "../MachineIndependent/Versions.h"
 #include "InfoSink.h"
 
 class TCompiler;
@@ -91,7 +91,7 @@ public:
     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; }
index bace3b2..6b77f37 100644 (file)
@@ -566,7 +566,7 @@ int ShCompile(
                 //
                 // Call the machine dependent compiler
                 //
-                if (! compiler->compile(parseContext.treeRoot))
+                if (! compiler->compile(parseContext.treeRoot, parseContext.version, parseContext.profile))
                     success = false;
             }
         }