Mesa (radeon-rewrite): Remove subpixel offset from viewport

Alex Deucher agd5f at kemper.freedesktop.org
Wed May 13 22:58:24 UTC 2009


Module: Mesa
Branch: radeon-rewrite
Commit: 038f0bf5916df5bae1145d234589e5fd528bb7fa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=038f0bf5916df5bae1145d234589e5fd528bb7fa

Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Fri May  8 18:58:41 2009 -0400

Remove subpixel offset from viewport

Remove an eigth-pixel offset of the viewport inherited from
R100 code. This seems not to be necessary and causes blurring
when sampling textures 1:1.

https://bugs.freedesktop.org/show_bug.cgi?id=20340

---

 src/mesa/drivers/dri/r300/r300_state.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 301ede3..b823995 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -923,12 +923,6 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face,
  * Window position and viewport transformation
  */
 
-/*
- * To correctly position primitives:
- */
-#define SUBPIXEL_X 0.125
-#define SUBPIXEL_Y 0.125
-
 static void r300UpdateWindow(GLcontext * ctx)
 {
 	r300ContextPtr rmesa = R300_CONTEXT(ctx);
@@ -949,9 +943,9 @@ static void r300UpdateWindow(GLcontext * ctx)
 	}
 
 	GLfloat sx = v[MAT_SX];
-	GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
+	GLfloat tx = v[MAT_TX] + xoffset;
 	GLfloat sy = v[MAT_SY] * y_scale;
-	GLfloat ty = (v[MAT_TY] * y_scale) + y_bias + SUBPIXEL_Y;
+	GLfloat ty = (v[MAT_TY] * y_scale) + y_bias;
 	GLfloat sz = v[MAT_SZ] * depthScale;
 	GLfloat tz = v[MAT_TZ] * depthScale;
 
@@ -990,8 +984,8 @@ void r300UpdateViewportOffset(GLcontext * ctx)
 	GLfloat yoffset = (GLfloat) dPriv->y + dPriv->h;
 	const GLfloat *v = ctx->Viewport._WindowMap.m;
 
-	GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
-	GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
+	GLfloat tx = v[MAT_TX] + xoffset;
+	GLfloat ty = (-v[MAT_TY]) + yoffset;
 
 	if (rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] != r300PackFloat32(tx) ||
 	    rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] != r300PackFloat32(ty)) {




More information about the mesa-commit mailing list