From: Aapo Tahkola Date: Mon, 31 Jul 2006 23:21:50 +0000 (+0000) Subject: fix #6991 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=689df543db409e3c1d9c205f36bfea401bb876b5;p=mesa.git fix #6991 --- diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 4a5943a9f34..7655e48c6f2 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1676,14 +1676,24 @@ void r300UpdateShaders(r300ContextPtr rmesa) { GLcontext *ctx; struct r300_vertex_program *vp; + int i; ctx = rmesa->radeon.glCtx; if (rmesa->NewGLState && hw_tcl_on) { rmesa->NewGLState = 0; + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { + rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i]; + } + _tnl_UpdateFixedFunctionProgram(ctx); + for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { + TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; + } + vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx); if (vp->translated == GL_FALSE) r300_translate_vertex_shader(vp); diff --git a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c index 21f4d430482..34834ca08fa 100644 --- a/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c +++ b/src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c @@ -303,14 +303,7 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G if (ctx->NewState) _mesa_update_state( ctx ); - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i]; - } r300UpdateShaders(rmesa); - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; - } if (rmesa->state.VB.LockCount) { if (rmesa->state.VB.lock_uptodate == GL_FALSE) { @@ -487,14 +480,7 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei if (ctx->NewState) _mesa_update_state( ctx ); - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i]; - } r300UpdateShaders(rmesa); - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; - } if (rmesa->state.VB.LockCount) { if (rmesa->state.VB.lock_uptodate == GL_FALSE) { @@ -583,14 +569,7 @@ static void radeonDrawArrays( GLenum mode, GLint start, GLsizei count ) /* XXX: setup_arrays before state update? */ - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i]; - } r300UpdateShaders(rmesa); - for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i]; - } if (rmesa->state.VB.LockCount) { if (rmesa->state.VB.lock_uptodate == GL_FALSE) {