Compiler - implement gl_DepthRange
TRAC #11380
Signed-off-by: Daniel Koch

Author:    Nicolas Capens <nicolas@transgaming.com>

git-svn-id: https://angleproject.googlecode.com/svn/trunk@16 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/libGLESv2/Context.cpp b/libGLESv2/Context.cpp
index bcc8368..9aada33 100644
--- a/libGLESv2/Context.cpp
+++ b/libGLESv2/Context.cpp
@@ -25,6 +25,9 @@
 #include "geometry/VertexDataManager.h"
 #include "geometry/dx9.h"
 
+#undef near
+#undef far
+
 namespace gl
 {
 Context::Context(const egl::Config *config)
@@ -792,6 +795,16 @@
         GLuint halfPixelSize = programObject->getUniformLocation("gl_HalfPixelSize");
         GLfloat xy[2] = {1.0f / description.Width, 1.0f / description.Height};
         programObject->setUniform2fv(halfPixelSize, 1, (GLfloat*)&xy);
+
+        GLuint near = programObject->getUniformLocation("gl_DepthRange.near");
+        programObject->setUniform1fv(near, 1, &zNear);
+
+        GLuint far = programObject->getUniformLocation("gl_DepthRange.far");
+        programObject->setUniform1fv(far, 1, &zFar);
+
+        GLuint diff = programObject->getUniformLocation("gl_DepthRange.diff");
+        GLfloat zDiff = zFar - zNear;
+        programObject->setUniform1fv(diff, 1, &zDiff);
     }
 
     return true;