Combine dx_Depth and dx_FrontCCW into dx_DepthFront.

TRAC #22245
Signed-off-by: Daniel Koch
Signed-off-by: Geoff Lang
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1582 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 8c3cae6..088f654 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -384,8 +384,8 @@
     mForceSetScissor = false;
 }
 
-bool Renderer11::setViewport(const gl::Rectangle &viewport, float zNear, float zFar, bool ignoreViewport,
-                             gl::ProgramBinary *currentProgram, bool forceSetUniforms)
+bool Renderer11::setViewport(const gl::Rectangle &viewport, float zNear, float zFar, GLenum drawMode, GLenum frontFace, 
+                             bool ignoreViewport, gl::ProgramBinary *currentProgram, bool forceSetUniforms)
 {
     gl::Rectangle actualViewport = viewport;
     float actualZNear = gl::clamp01(zNear);
@@ -439,9 +439,10 @@
                             actualViewport.y + (actualViewport.height * 0.5f) };
         currentProgram->setUniform4fv(coord, 1, whxy);
 
-        GLint depth = currentProgram->getDxDepthLocation();
-        GLfloat dz[2] = { (actualZFar - actualZNear) * 0.5f, (actualZNear + actualZFar) * 0.5f };
-        currentProgram->setUniform2fv(depth, 1, dz);
+        GLint depthFront = currentProgram->getDxDepthFrontLocation();
+        GLfloat ccw = !gl::IsTriangleMode(drawMode) ? 0.0f : (frontFace == GL_CCW ? 1.0f : -1.0f);
+        GLfloat dz[3] = { (actualZFar - actualZNear) * 0.5f, (actualZNear + actualZFar) * 0.5f, ccw };
+        currentProgram->setUniform3fv(depthFront, 1, dz);
 
         GLint depthRange = currentProgram->getDxDepthRangeLocation();
         GLfloat nearFarDiff[3] = { actualZNear, actualZFar, actualZFar - actualZNear };