summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c10
-rw-r--r--src/mesa/drivers/dri/r300/radeon_vtxfmt_a.c21
2 files changed, 10 insertions, 21 deletions
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) {