Mesa (main): aux/vbuf: prevent uint underflow and assert if no vbs are dirty

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 21 23:06:28 UTC 2021


Module: Mesa
Branch: main
Commit: 43abed919e21fdca7bf228b573fc25e92a9944e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=43abed919e21fdca7bf228b573fc25e92a9944e1

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 21 10:08:01 2021 -0400

aux/vbuf: prevent uint underflow and assert if no vbs are dirty

if this mask is 0, there is nothing to do here

Fixes: e73bf3b805d ("gallium: add start_slot parameter to set_vertex_buffers")

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10929>

---

 src/gallium/auxiliary/util/u_vbuf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 4d826abdfa9..af6f56e4ac3 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -1600,7 +1600,8 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info,
    */
 
    u_upload_unmap(pipe->stream_uploader);
-   u_vbuf_set_driver_vertex_buffers(mgr);
+   if (mgr->dirty_real_vb_mask)
+      u_vbuf_set_driver_vertex_buffers(mgr);
 
    pipe->draw_vbo(pipe, &new_info, drawid_offset, indirect, &new_draw, 1);
 



More information about the mesa-commit mailing list