From 67bbfb9c68d0bf459f706a4cb50caf8245a37a34 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 10 Jun 2009 17:05:38 +0200 Subject: 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 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 4017224b10..c3817721dc 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; } -- cgit v1.2.3