From: Marek Olšák Date: Sun, 9 Mar 2014 21:10:27 +0000 (+0100) Subject: r600g,radeonsi: don't add streamout.num_dw_for_end twice X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=958ef47a6dea652d79a676625b69b3dec6042395;p=mesa.git r600g,radeonsi: don't add streamout.num_dw_for_end twice It's already added in need_cs_space. Also don't calculate anything if there are no buffers. Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/drivers/radeon/r600_streamout.c b/src/gallium/drivers/radeon/r600_streamout.c index a556e3ae0e0..d9b1d1c8e5e 100644 --- a/src/gallium/drivers/radeon/r600_streamout.c +++ b/src/gallium/drivers/radeon/r600_streamout.c @@ -79,6 +79,9 @@ void r600_streamout_buffers_dirty(struct r600_common_context *rctx) unsigned num_bufs_appended = util_bitcount(rctx->streamout.enabled_mask & rctx->streamout.append_bitmask); + if (!num_bufs) + return; + rctx->streamout.num_dw_for_end = 12 + /* flush_vgt_streamout */ num_bufs * 8 + /* STRMOUT_BUFFER_UPDATE */ @@ -99,8 +102,7 @@ void r600_streamout_buffers_dirty(struct r600_common_context *rctx) begin->num_dw += num_bufs_appended * 8 + /* STRMOUT_BUFFER_UPDATE */ (num_bufs - num_bufs_appended) * 6 + /* STRMOUT_BUFFER_UPDATE */ - (rctx->family > CHIP_R600 && rctx->family < CHIP_RS780 ? 2 : 0) + /* SURFACE_BASE_UPDATE */ - rctx->streamout.num_dw_for_end; + (rctx->family > CHIP_R600 && rctx->family < CHIP_RS780 ? 2 : 0); /* SURFACE_BASE_UPDATE */ begin->dirty = true; }