Skip to content
Snippets Groups Projects
Commit 93a264f7 authored by Mike Blumenkrantz's avatar Mike Blumenkrantz :lifter: Committed by Dylan Baker
Browse files

util/draw: handle draw_count=0 when reading indirect parameters


Fixes: 3eb99323 ("aux/draw: add a util function for reading back indirect draw params")

Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <mesa/mesa!15963>
(cherry picked from commit 07437fa3)
parent 340e0425
No related branches found
No related tags found
No related merge requests found
......@@ -308,7 +308,7 @@
"description": "util/draw: handle draw_count=0 when reading indirect parameters",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"because_sha": "3eb99323172902d34c80782aaa2d110567749cd9"
},
{
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment