Commit b1092bf3 by apatrick@chromium.org

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
parent a5fd7a5a
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 646 #define BUILD_REVISION 647
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1456,8 +1456,8 @@ bool Program::linkVaryings() ...@@ -1456,8 +1456,8 @@ bool Program::linkVaryings()
{ {
mPixelHLSL += " float rhw = 1.0 / input.gl_FragCoord.w;\n"; mPixelHLSL += " float rhw = 1.0 / input.gl_FragCoord.w;\n";
if (sm3) { if (sm3) {
mPixelHLSL += " gl_FragCoord.x = input.dx_VPos.x;\n" mPixelHLSL += " gl_FragCoord.x = input.dx_VPos.x + 0.5;\n"
" gl_FragCoord.y = 2.0 * dx_Viewport.y - input.dx_VPos.y;\n"; " gl_FragCoord.y = 2.0 * dx_Viewport.y - input.dx_VPos.y - 0.5;\n";
} else { } else {
mPixelHLSL += " gl_FragCoord.x = (input.gl_FragCoord.x * rhw) * dx_Viewport.x + dx_Viewport.z;\n" 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"; " gl_FragCoord.y = -(input.gl_FragCoord.y * rhw) * dx_Viewport.y + dx_Viewport.w;\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment