Added mechanism to predefine associated macros for extensions. Also refactored the way extension behavior is initialized and updated.
Please note that I still need to add validation that appropriate extensions are enabled before using an extension function.
BUG=25
Review URL: http://codereview.appspot.com/2139042
git-svn-id: https://angleproject.googlecode.com/svn/trunk@413 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/ShHandle.h b/src/compiler/ShHandle.h
index 5ef5d30..b18f90c 100644
--- a/src/compiler/ShHandle.h
+++ b/src/compiler/ShHandle.h
@@ -16,6 +16,7 @@
#include "GLSLANG/ShaderLang.h"
+#include "compiler/ExtensionBehavior.h"
#include "compiler/InfoSink.h"
#include "compiler/SymbolTable.h"
@@ -44,6 +45,7 @@
EShLanguage getLanguage() const { return language; }
EShSpec getSpec() const { return spec; }
TSymbolTable& getSymbolTable() { return symbolTable; }
+ TExtensionBehavior& getExtensionBehavior() { return extensionBehavior; }
TInfoSink& getInfoSink() { return infoSink; }
virtual bool compile(TIntermNode* root) = 0;
@@ -57,6 +59,8 @@
// Built-in symbol table for the given language, spec, and resources.
// It is preserved from compile-to-compile.
TSymbolTable symbolTable;
+ // Built-in extensions with default behavior.
+ TExtensionBehavior extensionBehavior;
// Output sink.
TInfoSink infoSink;
};