Assign register indexes to dx_ constants and intercept them.

TRAC #22326
Signed-off-by: Daniel Koch
Signed-off-by: Shannon Woods
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1631 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index 3eaa60f..446cbb7 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -2112,6 +2112,31 @@
 
 bool ProgramBinary::defineUniform(GLenum shader, const sh::Uniform &constant, InfoLog &infoLog)
 {
+    if (constant.name == "dx_DepthRange")
+    {
+        if (shader == GL_VERTEX_SHADER)   mDxDepthRangeRegisterVS = constant.registerIndex;
+        if (shader == GL_FRAGMENT_SHADER) mDxDepthRangeRegisterPS = constant.registerIndex;
+        return true;
+    }
+
+    if (constant.name == "dx_DepthFront")
+    {
+        mDxDepthFrontRegister = constant.registerIndex;
+        return true;
+    }
+
+    if (constant.name == "dx_Coord")
+    {
+        mDxCoordRegister = constant.registerIndex;
+        return true;
+    }
+
+    if (constant.name == "dx_HalfPixelSize")
+    {
+        mDxHalfPixelSizeRegister = constant.registerIndex;
+        return true;
+    }
+
     if (constant.type == GL_SAMPLER_2D ||
         constant.type == GL_SAMPLER_CUBE)
     {