Fix extension behavior in shader validation.

If an extension is not specified, it is disabled by default, thus a shader should fail compiling if features from that extension are used.

ANGLEBUG=204
TEST=webgl conformance/extensions/oes-standard-derivatives.html
Review URL: http://codereview.appspot.com/4974071

git-svn-id: http://angleproject.googlecode.com/svn/trunk@745 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/samples/translator/translator.cpp b/samples/translator/translator.cpp
index f227760..a4bf6c2 100644
--- a/samples/translator/translator.cpp
+++ b/samples/translator/translator.cpp
@@ -97,7 +97,17 @@
                     failCode = EFailUsage;
                 }
                 break;
-            case 'a': resources.OES_EGL_image_external = 1; break;
+            case 'x':
+                if (argv[0][2] == '=') {
+                    switch (argv[0][3]) {
+                    case 'i': resources.OES_EGL_image_external = 1; break;
+                    case 'd': resources.OES_standard_derivatives = 1; break;
+                    default: failCode = EFailUsage;
+                    }
+                } else {
+                    failCode = EFailUsage;
+                }
+                break;
             default: failCode = EFailUsage;
             }
         } else {
@@ -178,7 +188,7 @@
 //
 void usage()
 {
-    printf("Usage: translate [-i -m -o -u -l -e -b=e -b=g -b=h -a] file1 file2 ...\n"
+    printf("Usage: translate [-i -m -o -u -l -e -b=e -b=g -b=h -x=i -x=d] file1 file2 ...\n"
         "Where: filename : filename ending in .frag or .vert\n"
         "       -i       : print intermediate tree\n"
         "       -m       : map long variable names\n"
@@ -189,7 +199,8 @@
         "       -b=e     : output GLSL ES code (this is by default)\n"
         "       -b=g     : output GLSL code\n"
         "       -b=h     : output HLSL code\n"
-        "       -a       : enable GL_OES_EGL_image_external\n");
+        "       -x=i     : enable GL_OES_EGL_image_external\n"
+        "       -x=d     : enable GL_OES_EGL_standard_derivatives\n");
 }
 
 //
diff --git a/src/common/version.h b/src/common/version.h
index c577808..28d5925 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
 #define MAJOR_VERSION 0
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 744
+#define BUILD_REVISION 745
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp
index dd997fc..11c5e6c 100644
--- a/src/compiler/ParseHelper.cpp
+++ b/src/compiler/ParseHelper.cpp
@@ -929,7 +929,8 @@
         error(line, "extension", extension.c_str(), "is not supported");
         return true;
     }
-    if (iter->second == EBhDisable) {
+    // In GLSL ES, an extension's default behavior is "disable".
+    if (iter->second == EBhDisable || iter->second == EBhUndefined) {
         error(line, "extension", extension.c_str(), "is disabled");
         return true;
     }