radeon/r200/r300: don't clean non-emitted state.
authorDave Airlie <airlied@redhat.com>
Wed, 27 Jan 2010 01:46:26 +0000 (11:46 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 27 Jan 2010 02:48:47 +0000 (12:48 +1000)
So if we don't actually emit an atom to the hw because we don't
need it in the current state (e.g. lighting related atoms when
lighting is off) then don't mark it as clean, because when
lighting gets switched on we won't emit it at all.

This fixes funky gears colors.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/radeon/radeon_common.c

index e0b853bc97da97356c99493b0b026718d9ef03e2..79f3ff7da65de095ffe90e89202b119248e8afa4 100644 (file)
@@ -1036,10 +1036,11 @@ static INLINE void radeon_emit_atom(radeonContextPtr radeon, struct radeon_state
                        OUT_BATCH_TABLE(atom->cmd, dwords);
                        END_BATCH();
                }
+               atom->dirty = GL_FALSE;
+
        } else {
                radeon_print(RADEON_STATE, RADEON_VERBOSE, "  skip state %s\n", atom->name);
        }
-       atom->dirty = GL_FALSE;
 
 }