Merge remote branch 'upstream/gallium-0.1' into gallium-0.1
[mesa.git] / src / gallium / drivers / nv30 / nv30_state_emit.c
index 541ad0da3e876aea1f6481ebc954d989e1cf463a..eca1f0652cc68ed185e81618137d4d8aec10eb72 100644 (file)
@@ -3,7 +3,13 @@
 
 static struct nv30_state_entry *render_states[] = {
        &nv30_state_framebuffer,
+       &nv30_state_rasterizer,
+       &nv30_state_scissor,
+       &nv30_state_stipple,
+       &nv30_state_blend,
        &nv30_state_blend_colour,
+       &nv30_state_zsa,
+       &nv30_state_viewport,
        NULL
 };
 
@@ -40,9 +46,19 @@ void
 nv30_emit_hw_state(struct nv30_context *nv30)
 {
        struct nv30_state *state = &nv30->state;
+       struct nv30_screen *screen = nv30->screen;
        unsigned i;
        uint64 states;
 
+       if (nv30->pctx_id != screen->cur_pctx) {
+               for (i = 0; i < NV30_STATE_MAX; i++) {
+                       if (state->hw[i] && screen->state[i] != state->hw[i])
+                               state->dirty |= (1ULL << i);
+               }
+
+               screen->cur_pctx = nv30->pctx_id;
+       }
+
        for (i = 0, states = state->dirty; states; i++) {
                if (!(states & (1ULL << i)))
                        continue;