Mesa (radeon-rewrite): r300: fix VAP setup

Maciej Cencora osiris at kemper.freedesktop.org
Thu Jun 11 23:11:37 UTC 2009


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

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Wed Jun 10 17:05:38 2009 +0200

r300: fix VAP setup

If GL context had e.g. tex0, tex2 and fog the VAPOutputCntl1 returned 0x104 instead of 0x124 - that meaned we're sending only 8 texcoords (instead of 12) which ended up in GPU hang.

---

 src/mesa/drivers/dri/r300/r300_emit.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index 4017224..c381772 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -111,7 +111,7 @@ GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint vp_writes, GLuint fp_reads)
 
 	for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
 		if (vp_writes & (1 << (VERT_RESULT_TEX0 + i)) && fp_reads & FRAG_BIT_TEX(i)) {
-			ret |= (4 << (3 * i));
+			ret |= (4 << (3 * first_free_texcoord));
 			++first_free_texcoord;
 		}
 	}
@@ -122,13 +122,14 @@ GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint vp_writes, GLuint fp_reads)
 	}
 
 	if (vp_writes & (1 << VERT_RESULT_FOGC) && fp_reads & FRAG_BIT_FOGC) {
-		if (first_free_texcoord > 8) {
-			fprintf(stderr, "\tout of free texcoords to write fog coord\n");
-			_mesa_exit(-1);
-		}
 		ret |= 4 << (3 * first_free_texcoord);
 	}
 
+	if (first_free_texcoord > 8) {
+		fprintf(stderr, "\tout of free texcoords\n");
+		_mesa_exit(-1);
+	}
+
 	return ret;
 }
 




More information about the mesa-commit mailing list