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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 22:22:07 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 040168696891c7c5d49c2c9f2203bf8b53f675b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=040168696891c7c5d49c2c9f2203bf8b53f675b5

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 19d644528d1..a9b287742db 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) {



More information about the mesa-commit mailing list