From 958ef47a6dea652d79a676625b69b3dec6042395 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 9 Mar 2014 22:10:27 +0100 Subject: [PATCH] r600g,radeonsi: don't add streamout.num_dw_for_end twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's already added in need_cs_space. Also don't calculate anything if there are no buffers. Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeon/r600_streamout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.30.2