r600g: compute CS space for streamout correctly, add comments
authorMarek Olšák <maraeo@gmail.com>
Thu, 14 Jun 2012 20:25:50 +0000 (22:25 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 15 Jun 2012 20:43:00 +0000 (22:43 +0200)
SET_CONTEXT_REG was not counted in.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_hw_context.c

index 0fed95c576cd62b053a8bb3d35a50d199c3d274e..1b1c6f4af6501b8d73942e35ad23609a18f05c23 100644 (file)
@@ -1324,15 +1324,16 @@ void r600_context_streamout_begin(struct r600_context *ctx)
 
        ctx->num_cs_dw_streamout_end =
                12 + /* flush_vgt_streamout */
-               util_bitcount(buffer_en) * 8 +
-               3;
+               util_bitcount(buffer_en) * 8 + /* STRMOUT_BUFFER_UPDATE */
+               3 /* set_streamout_enable(0) */;
 
        r600_need_cs_space(ctx,
                           12 + /* flush_vgt_streamout */
-                          6 + /* enables */
-                          util_bitcount(buffer_en & ctx->streamout_append_bitmask) * 8 +
-                          util_bitcount(buffer_en & ~ctx->streamout_append_bitmask) * 6 +
-                          (ctx->family > CHIP_R600 && ctx->family < CHIP_RV770 ? 2 : 0) +
+                          6 + /* set_streamout_enable */
+                          util_bitcount(buffer_en) * 7 + /* SET_CONTEXT_REG */
+                          util_bitcount(buffer_en & ctx->streamout_append_bitmask) * 8 + /* STRMOUT_BUFFER_UPDATE */
+                          util_bitcount(buffer_en & ~ctx->streamout_append_bitmask) * 6 + /* STRMOUT_BUFFER_UPDATE */
+                          (ctx->family > CHIP_R600 && ctx->family < CHIP_RV770 ? 2 : 0) + /* SURFACE_BASE_UPDATE */
                           ctx->num_cs_dw_streamout_end, TRUE);
 
        if (ctx->chip_class >= EVERGREEN) {