Mesa (staging/22.1): util/draw: fix indirect draw count readback

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 18:54:05 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: f335548405a1d197a49321322ccd31a30b5f7a31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f335548405a1d197a49321322ccd31a30b5f7a31

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Apr 19 16:06:44 2022 -0400

util/draw: fix indirect draw count readback

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 <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15963>
(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 98fc5ff02da..abaf7fc5bd4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -337,7 +337,7 @@
         "description": "util/draw: fix indirect draw count readback",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "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) {



More information about the mesa-commit mailing list