From ec124916206fbae63ee9e3c2c73de8255c807c98 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 19 Apr 2022 16:06:44 -0400 Subject: [PATCH] util/draw: fix indirect draw count readback MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit if there is an indirect count, always use it Fixes: 3eb99323172 ("aux/draw: add a util function for reading back indirect draw params") Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_draw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_draw.c b/src/gallium/auxiliary/util/u_draw.c index 273724f..ed1e294 100644 --- a/src/gallium/auxiliary/util/u_draw.c +++ b/src/gallium/auxiliary/util/u_draw.c @@ -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) { -- 2.7.4