Fix gl_FragCoord.
Landing patch from this Chromium issue:
http://code.google.com/p/chromium/issues/detail?id=82166
Review URL: http://codereview.appspot.com/4528055
git-svn-id: https://angleproject.googlecode.com/svn/trunk@647 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/common/version.h b/src/common/version.h
index 3f8723b..02ade43 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,7 +1,7 @@
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
-#define BUILD_REVISION 646
+#define BUILD_REVISION 647
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/src/libGLESv2/Program.cpp b/src/libGLESv2/Program.cpp
index fb44fc2..dbae77e 100644
--- a/src/libGLESv2/Program.cpp
+++ b/src/libGLESv2/Program.cpp
@@ -1456,8 +1456,8 @@
{
mPixelHLSL += " float rhw = 1.0 / input.gl_FragCoord.w;\n";
if (sm3) {
- mPixelHLSL += " gl_FragCoord.x = input.dx_VPos.x;\n"
- " gl_FragCoord.y = 2.0 * dx_Viewport.y - input.dx_VPos.y;\n";
+ mPixelHLSL += " gl_FragCoord.x = input.dx_VPos.x + 0.5;\n"
+ " gl_FragCoord.y = 2.0 * dx_Viewport.y - input.dx_VPos.y - 0.5;\n";
} else {
mPixelHLSL += " gl_FragCoord.x = (input.gl_FragCoord.x * rhw) * dx_Viewport.x + dx_Viewport.z;\n"
" gl_FragCoord.y = -(input.gl_FragCoord.y * rhw) * dx_Viewport.y + dx_Viewport.w;\n";