Don't expose DX constants as GL uniforms.
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@1583 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 088f654..1f85f36 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -427,26 +427,18 @@
if (currentProgram && (viewportChanged || forceSetUniforms))
{
- GLint halfPixelSize = currentProgram->getDxHalfPixelSizeLocation();
- GLfloat xy[2] = { 0.0f, 0.0f };
- currentProgram->setUniform2fv(halfPixelSize, 1, xy);
+ currentProgram->applyDxHalfPixelSize(0.0f, 0.0f);
// These values are used for computing gl_FragCoord in Program::linkVaryings().
- GLint coord = currentProgram->getDxCoordLocation();
- GLfloat whxy[4] = { actualViewport.width * 0.5f,
- actualViewport.height * 0.5f,
- actualViewport.x + (actualViewport.width * 0.5f),
- actualViewport.y + (actualViewport.height * 0.5f) };
- currentProgram->setUniform4fv(coord, 1, whxy);
+ currentProgram->applyDxCoord(actualViewport.width * 0.5f,
+ actualViewport.height * 0.5f,
+ actualViewport.x + (actualViewport.width * 0.5f),
+ actualViewport.y + (actualViewport.height * 0.5f));
- 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);
+ currentProgram->applyDxDepthFront((actualZFar - actualZNear) * 0.5f, (actualZNear + actualZFar) * 0.5f, ccw);
- GLint depthRange = currentProgram->getDxDepthRangeLocation();
- GLfloat nearFarDiff[3] = { actualZNear, actualZFar, actualZFar - actualZNear };
- currentProgram->setUniform3fv(depthRange, 1, nearFarDiff);
+ currentProgram->applyDxDepthRange(actualZNear, actualZFar, actualZFar - actualZNear);
}
mForceSetViewport = false;