util/draw: fix indirect draw count readback

if there is an indirect count, always use it

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>
(cherry picked from commit ec12491620)
This commit is contained in:
Mike Blumenkrantz 2022-04-19 16:06:44 -04:00 committed by Dylan Baker
parent 93a264f7a8
commit 5d9d705952
2 changed files with 2 additions and 3 deletions

View file

@ -300,7 +300,7 @@
"description": "util/draw: fix indirect draw count readback",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"because_sha": "3eb99323172902d34c80782aaa2d110567749cd9"
},
{

View file

@ -150,8 +150,7 @@ util_draw_indirect_read(struct pipe_context *pipe,
debug_printf("%s: failed to map indirect draw count buffer\n", __FUNCTION__);
return NULL;
}
if (dc_param[0] < draw_count)
draw_count = dc_param[0];
draw_count = dc_param[0];
pipe_buffer_unmap(pipe, dc_transfer);
}
if (!draw_count) {