util/vbuf: clarify indirect draws handling
It wasn't obvious from the u_vbuf code alone that num_draws is guaranteed to be 1 in the indirect case. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
This commit is contained in:
committed by
Marge Bot
parent
2b717f01f7
commit
c19a3a6ddf
@@ -1512,6 +1512,9 @@ void u_vbuf_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *inf
|
||||
if (indirect && indirect->buffer) {
|
||||
unsigned draw_count = 0;
|
||||
|
||||
/* num_draws can only be 1 with indirect draws. */
|
||||
assert(num_draws == 1);
|
||||
|
||||
/* Get the number of draws. */
|
||||
if (indirect->indirect_draw_count) {
|
||||
pipe_buffer_read(pipe, indirect->indirect_draw_count,
|
||||
@@ -1547,6 +1550,7 @@ void u_vbuf_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *inf
|
||||
u_vbuf_split_indexed_multidraw(mgr, &new_info, drawid_offset, data,
|
||||
indirect->stride, draw_count);
|
||||
free(data);
|
||||
/* We're done (as num_draws is 1), so return early. */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1563,6 +1567,7 @@ void u_vbuf_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *inf
|
||||
u_vbuf_split_indexed_multidraw(mgr, &new_info, drawid_offset, data,
|
||||
indirect->stride, draw_count);
|
||||
free(data);
|
||||
/* We're done (as num_draws is 1), so return early. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user