mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
util/draw: handle draw_count=0 when reading indirect parameters
Fixes: 3eb9932317 ("aux/draw: add a util function for reading back indirect draw params")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
This commit is contained in:
parent
efca37d415
commit
07437fa3bd
1 changed files with 4 additions and 0 deletions
|
|
@ -154,6 +154,10 @@ util_draw_indirect_read(struct pipe_context *pipe,
|
|||
draw_count = dc_param[0];
|
||||
pipe_buffer_unmap(pipe, dc_transfer);
|
||||
}
|
||||
if (!draw_count) {
|
||||
*num_draws = draw_count;
|
||||
return NULL;
|
||||
}
|
||||
draws = malloc(sizeof(struct u_indirect_params) * draw_count);
|
||||
if (!draws)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue