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/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 4ab3789..2b4b656 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -253,6 +253,7 @@
             resources.EXT_draw_buffers = mRenderer->getMaxRenderTargets() > 1;
             // resources.OES_EGL_image_external = mRenderer->getShareHandleSupport() ? 1 : 0; // TODO: commented out until the extension is actually supported.
             resources.FragmentPrecisionHigh = 1;   // Shader Model 2+ always supports FP24 (s16e7) which corresponds to highp
+            resources.EXT_frag_depth = 1; // Shader Model 2+ always supports explicit depth output
             // GLSL ES 3.0 constants
             resources.MaxVertexOutputVectors = mRenderer->getMaxVaryingVectors();
             resources.MaxFragmentInputVectors = mRenderer->getMaxVaryingVectors();
@@ -330,6 +331,7 @@
         mUsesPointSize = strstr(mHlsl, "GL_USES_POINT_SIZE") != NULL;
         mUsesPointCoord = strstr(mHlsl, "GL_USES_POINT_COORD") != NULL;
         mUsesDepthRange = strstr(mHlsl, "GL_USES_DEPTH_RANGE") != NULL;
+        mUsesFragDepth = strstr(mHlsl, "GL_USES_FRAG_DEPTH") != NULL;
     }
 }
 
@@ -362,6 +364,7 @@
     mUsesPointSize = false;
     mUsesPointCoord = false;
     mUsesDepthRange = false;
+    mUsesFragDepth = false;
     mShaderVersion = 100;
 
     mActiveUniforms.clear();