Added support for EXT_frag_depth

This change also required that support be added for associating built-in
variables with an extension, similar to how functions could be associated with
extensions previously.

R=alokp@chromium.org

Review URL: https://codereview.appspot.com/9827044

git-svn-id: https://angleproject.googlecode.com/svn/trunk@2248 736b8ea6-26fd-11df-bfd4-992fa37f6226

TRAC #23333
Authored-by: bajones@chromium.org
Signed-off-by: Shannon Woods
Signed-off-by Nicolas Capens
Merged-by: Jamie Madill
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp
index 39aa7e3..1471fc2 100644
--- a/src/compiler/ParseHelper.cpp
+++ b/src/compiler/ParseHelper.cpp
@@ -1013,6 +1013,22 @@
     return static_cast<const TFunction*>(symbol);
 }
 
+bool TParseContext::isVariableBuiltIn(const TVariable* var)
+{
+    // First find by unmangled name to check whether the function name has been
+    // hidden by a variable name or struct typename.
+    const TSymbol* symbol = symbolTable.findBuiltIn(var->getName(), shaderVersion);
+    if (symbol == 0) {
+        symbol = symbolTable.findBuiltIn(var->getMangledName(), shaderVersion);
+    }
+
+    if (symbol == 0) {
+        return false;
+    }
+
+    return symbol->isVariable();
+}
+
 //
 // Initializers show up in several places in the grammar.  Have one set of
 // code to handle them here.