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/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index fe03997..1a3695b 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -83,10 +83,9 @@
     mUsedPixelSamplerRange = 0;
 
     mDxDepthRangeLocation = -1;
-    mDxDepthLocation = -1;
+    mDxDepthFrontLocation = -1;
     mDxCoordLocation = -1;
     mDxHalfPixelSizeLocation = -1;
-    mDxFrontCCWLocation = -1;
 }
 
 ProgramBinary::~ProgramBinary()
@@ -1462,7 +1461,7 @@
                           "    gl_FragCoord.y = (input.gl_FragCoord.y * rhw) * dx_Coord.y + dx_Coord.w;\n";
         }
         
-        pixelHLSL += "    gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_Depth.x + dx_Depth.y;\n"
+        pixelHLSL += "    gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_DepthFront.x + dx_DepthFront.y;\n"
                       "    gl_FragCoord.w = rhw;\n";
     }
 
@@ -1474,7 +1473,7 @@
 
     if (fragmentShader->mUsesFrontFacing)
     {
-        pixelHLSL += "    gl_FrontFacing = (input.vFace * dx_FrontCCW >= 0.0);\n";
+        pixelHLSL += "    gl_FrontFacing = (input.vFace * dx_DepthFront.z >= 0.0);\n";
     }
 
     for (VaryingList::iterator varying = fragmentShader->mVaryings.begin(); varying != fragmentShader->mVaryings.end(); varying++)
@@ -1625,10 +1624,9 @@
     }
 
     stream.read(&mDxDepthRangeLocation);
-    stream.read(&mDxDepthLocation);
+    stream.read(&mDxDepthFrontLocation);
     stream.read(&mDxCoordLocation);
     stream.read(&mDxHalfPixelSizeLocation);
-    stream.read(&mDxFrontCCWLocation);
 
     unsigned int pixelShaderSize;
     stream.read(&pixelShaderSize);
@@ -1733,10 +1731,9 @@
     }
 
     stream.write(mDxDepthRangeLocation);
-    stream.write(mDxDepthLocation);
+    stream.write(mDxDepthFrontLocation);
     stream.write(mDxCoordLocation);
     stream.write(mDxHalfPixelSizeLocation);
-    stream.write(mDxFrontCCWLocation);
 
     UINT pixelShaderSize = mPixelExecutable->getLength();
     stream.write(pixelShaderSize);
@@ -1859,10 +1856,9 @@
     // these uniforms are searched as already-decorated because gl_ and dx_
     // are reserved prefixes, and do not receive additional decoration
     mDxDepthRangeLocation = getUniformLocation("dx_DepthRange");
-    mDxDepthLocation = getUniformLocation("dx_Depth");
+    mDxDepthFrontLocation = getUniformLocation("dx_DepthFront");
     mDxCoordLocation = getUniformLocation("dx_Coord");
     mDxHalfPixelSizeLocation = getUniformLocation("dx_HalfPixelSize");
-    mDxFrontCCWLocation = getUniformLocation("dx_FrontCCW");
 
     Context *context = getContext();
     context->markDxUniformsDirty();
@@ -2655,9 +2651,9 @@
     return mDxDepthRangeLocation;
 }
 
-GLint ProgramBinary::getDxDepthLocation() const
+GLint ProgramBinary::getDxDepthFrontLocation() const
 {
-    return mDxDepthLocation;
+    return mDxDepthFrontLocation;
 }
 
 GLint ProgramBinary::getDxCoordLocation() const
@@ -2670,11 +2666,6 @@
     return mDxHalfPixelSizeLocation;
 }
 
-GLint ProgramBinary::getDxFrontCCWLocation() const
-{
-    return mDxFrontCCWLocation;
-}
-
 ProgramBinary::Sampler::Sampler() : active(false), logicalTextureUnit(0), textureType(TEXTURE_2D)
 {
 }