It's already added in need_cs_space.
Also don't calculate anything if there are no buffers.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
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 */
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;
}