From 5d9d705952f4473a9bda9c2212468fc979692057 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=UTF-8 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: (cherry picked from commit ec124916206fbae63ee9e3c2c73de8255c807c98) --- .pick_status.json | 2 +- src/gallium/auxiliary/util/u_draw.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f00b287e5cf..5f7ca19f454 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -300,7 +300,7 @@ "description": "util/draw: fix indirect draw count readback", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "3eb99323172902d34c80782aaa2d110567749cd9" }, { diff --git a/src/gallium/auxiliary/util/u_draw.c b/src/gallium/auxiliary/util/u_draw.c index 273724f2a0a..ed1e294a556 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) {