r600g: setup streamout before calling last r600_need_cs_space before drawing
authorMarek Olšák <maraeo@gmail.com>
Wed, 18 Jul 2012 16:33:37 +0000 (18:33 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 18 Jul 2012 20:42:58 +0000 (22:42 +0200)
This fixes CS checker errors due to registers not being initialized, because
the flush occured after dirty state was emitted but before drawing.

src/gallium/drivers/r600/r600_state_common.c

index 2c95878ef255ba6569d1a650ae9a353a7356a95f..f91f2654f58f3c45da83a18473f9b0b62eb985b9 100644 (file)
@@ -1069,6 +1069,12 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
 
        r600_context_pipe_state_set(rctx, &rctx->vgt);
 
+       /* Enable stream out if needed. */
+       if (rctx->streamout_start) {
+               r600_context_streamout_begin(rctx);
+               rctx->streamout_start = FALSE;
+       }
+
        /* Emit states (the function expects that we emit at most 17 dwords here). */
        r600_need_cs_space(rctx, 0, TRUE);
 
@@ -1080,12 +1086,6 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
        }
        rctx->pm4_dirty_cdwords = 0;
 
-       /* Enable stream out if needed. */
-       if (rctx->streamout_start) {
-               r600_context_streamout_begin(rctx);
-               rctx->streamout_start = FALSE;
-       }
-
        /* draw packet */
        cs->buf[cs->cdw++] = PKT3(PKT3_NUM_INSTANCES, 0, rctx->predicate_drawing);
        cs->buf[cs->cdw++] = info.instance_count;