Added support for associating functions with extensions and performing validation when those functions are used in a shader.
BUG=25
Review URL: http://codereview.appspot.com/2141046
git-svn-id: https://angleproject.googlecode.com/svn/trunk@415 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/SymbolTable.cpp b/src/compiler/SymbolTable.cpp
index 1b08667..02817d4 100644
--- a/src/compiler/SymbolTable.cpp
+++ b/src/compiler/SymbolTable.cpp
@@ -140,6 +140,22 @@
}
}
+//
+// Change all function entries in the table with the non-mangled name
+// to be related to the provided built-in extension. This is a low
+// performance operation, and only intended for symbol tables that
+// live across a large number of compiles.
+//
+void TSymbolTableLevel::relateToExtension(const char* name, const TString& ext)
+{
+ for (tLevel::iterator it = level.begin(); it != level.end(); ++it) {
+ if (it->second->isFunction()) {
+ TFunction* function = static_cast<TFunction*>(it->second);
+ if (function->getName() == name)
+ function->relateToExtension(ext);
+ }
+ }
+}
TSymbol::TSymbol(const TSymbol& copyOf)
{