Added an option for specifying language specification in preparation for supporting WebGL in addition to GLES2. This CL just replaces unused debugOptions variable with EShSpec variable.
BUG=11
Review URL: http://codereview.appspot.com/1692051

git-svn-id: https://angleproject.googlecode.com/svn/trunk@344 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/CodeGenGLSL.cpp b/src/compiler/CodeGenGLSL.cpp
index 1991cf8..855b092 100644
--- a/src/compiler/CodeGenGLSL.cpp
+++ b/src/compiler/CodeGenGLSL.cpp
@@ -11,9 +11,9 @@
 // compile object used by higher level code.  It returns
 // a subclass of TCompiler.
 //
-TCompiler* ConstructCompiler(EShLanguage language, int debugOptions)
+TCompiler* ConstructCompiler(EShLanguage language, EShSpec spec)
 {
-    return new TranslatorGLSL(language, debugOptions);
+    return new TranslatorGLSL(language, spec);
 }
 
 //
diff --git a/src/compiler/CodeGenHLSL.cpp b/src/compiler/CodeGenHLSL.cpp
index a180f49..4db771d 100644
--- a/src/compiler/CodeGenHLSL.cpp
+++ b/src/compiler/CodeGenHLSL.cpp
@@ -11,9 +11,9 @@
 // compile object used by higher level code.  It returns
 // a subclass of TCompiler.
 //
-TCompiler* ConstructCompiler(EShLanguage language, int debugOptions)
+TCompiler* ConstructCompiler(EShLanguage language, EShSpec spec)
 {
-    return new TranslatorHLSL(language, debugOptions);
+    return new TranslatorHLSL(language, spec);
 }
 
 //
diff --git a/src/compiler/ShHandle.h b/src/compiler/ShHandle.h
index 47b9785..b0dccc4 100644
--- a/src/compiler/ShHandle.h
+++ b/src/compiler/ShHandle.h
@@ -56,7 +56,7 @@
 //
 class TCompiler : public TShHandleBase {
 public:
-    TCompiler(EShLanguage l) : language(l), haveValidObjectCode(false) { }
+    TCompiler(EShLanguage l, EShSpec s) : language(l), spec(s), haveValidObjectCode(false) { }
     virtual ~TCompiler() { }
     EShLanguage getLanguage() { return language; }
     virtual TInfoSink& getInfoSink() { return infoSink; }
@@ -69,6 +69,7 @@
     TInfoSink infoSink;
 protected:
     EShLanguage language;
+    EShSpec spec;
     bool haveValidObjectCode;
 };
 
@@ -125,7 +126,7 @@
 // destroy the machine dependent objects, which contain the
 // above machine independent information.
 //
-TCompiler* ConstructCompiler(EShLanguage, int);
+TCompiler* ConstructCompiler(EShLanguage, EShSpec);
 
 TShHandleBase* ConstructLinker(EShExecutable, int);
 void DeleteLinker(TShHandleBase*);
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index 913a511..d12ea4b 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -82,12 +82,12 @@
 // objects.
 //
 
-ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
+ShHandle ShConstructCompiler(EShLanguage language, EShSpec spec)
 {
     if (!InitThread())
         return 0;
 
-    TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, debugOptions));
+    TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, spec));
     
     return reinterpret_cast<void*>(base);
 }
diff --git a/src/compiler/TranslatorGLSL.cpp b/src/compiler/TranslatorGLSL.cpp
index 6149d72..7b8d903 100644
--- a/src/compiler/TranslatorGLSL.cpp
+++ b/src/compiler/TranslatorGLSL.cpp
@@ -8,9 +8,8 @@
 
 #include "compiler/OutputGLSL.h"
 
-TranslatorGLSL::TranslatorGLSL(EShLanguage l, int dOptions)
-        : TCompiler(l),
-          debugOptions(dOptions) {
+TranslatorGLSL::TranslatorGLSL(EShLanguage lang, EShSpec spec)
+    : TCompiler(lang, spec) {
 }
 
 bool TranslatorGLSL::compile(TIntermNode* root) {
diff --git a/src/compiler/TranslatorGLSL.h b/src/compiler/TranslatorGLSL.h
index 1ccd3fb..973e39a 100644
--- a/src/compiler/TranslatorGLSL.h
+++ b/src/compiler/TranslatorGLSL.h
@@ -11,9 +11,8 @@
 
 class TranslatorGLSL : public TCompiler {
 public:
-    TranslatorGLSL(EShLanguage l, int dOptions);
+    TranslatorGLSL(EShLanguage lang, EShSpec spec);
     virtual bool compile(TIntermNode* root);
-    int debugOptions;
 };
 
 #endif  // COMPILER_TRANSLATORGLSL_H_
diff --git a/src/compiler/TranslatorHLSL.cpp b/src/compiler/TranslatorHLSL.cpp
index d8dc800..3a1e52d 100644
--- a/src/compiler/TranslatorHLSL.cpp
+++ b/src/compiler/TranslatorHLSL.cpp
@@ -8,8 +8,8 @@
 
 #include "compiler/OutputHLSL.h"
 
-TranslatorHLSL::TranslatorHLSL(EShLanguage language, int debugOptions)
-    : TCompiler(language), debugOptions(debugOptions)
+TranslatorHLSL::TranslatorHLSL(EShLanguage lang, EShSpec spec)
+    : TCompiler(lang, spec)
 {
 }
 
diff --git a/src/compiler/TranslatorHLSL.h b/src/compiler/TranslatorHLSL.h
index 029479f..38a5f0c 100644
--- a/src/compiler/TranslatorHLSL.h
+++ b/src/compiler/TranslatorHLSL.h
@@ -11,9 +11,8 @@
 
 class TranslatorHLSL : public TCompiler {
 public:
-    TranslatorHLSL(EShLanguage l, int dOptions);
+    TranslatorHLSL(EShLanguage lang, EShSpec spec);
     virtual bool compile(TIntermNode* root);
-    int debugOptions;
 };
 
 #endif  // COMPILER_TRANSLATORHLSL_H_
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 04682a4..6ec3784 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -34,8 +34,8 @@
 
         if (result)
         {
-            mFragmentCompiler = ShConstructCompiler(EShLangFragment, EDebugOpObjectCode);
-            mVertexCompiler = ShConstructCompiler(EShLangVertex, EDebugOpObjectCode);
+            mFragmentCompiler = ShConstructCompiler(EShLangFragment, EShSpecGLES2);
+            mVertexCompiler = ShConstructCompiler(EShLangVertex, EShSpecGLES2);
         }
     }