From cccca8d140a3c843cdaeff8b5fbfedd8677f2f9a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 9 Sep 2025 10:50:09 -0400 Subject: [PATCH] util/vbuf: stop nooping set_vertex_buffers calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this sucks, but if the gallium expectation is that changing vertex state always requires a vb update, vbuf can no longer deduplicate repeated calls Fixes: 1638d486ff9 ("gallium/u_threaded,st/mesa: add a merged set_vertex_elements_and_buffers call") Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_vbuf.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 882f683e2a3..41fcefcb70f 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -1021,7 +1021,6 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf *mgr, uint32_t incompatible_vb_mask = 0; /* which buffers are unaligned to 2/4 bytes */ uint32_t unaligned_vb_mask[2] = {0}; - unsigned num_identical = 0; for (i = 0; i < count; i++) { const struct pipe_vertex_buffer *vb = &bufs[i]; @@ -1034,12 +1033,6 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf *mgr, continue; } - /* The structure has holes: do not use memcmp. */ - if (orig_vb->is_user_buffer == vb->is_user_buffer && - orig_vb->buffer_offset == vb->buffer_offset && - orig_vb->buffer.resource == vb->buffer.resource) - num_identical++; - *orig_vb = *vb; enabled_vb_mask |= 1 << i; @@ -1071,10 +1064,6 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf *mgr, } unsigned last_count = mgr->num_vertex_buffers; - - if (num_identical == count && count == last_count) - return; - for (; i < last_count; i++) { memset(&mgr->vertex_buffer[i], 0, sizeof(struct pipe_vertex_buffer)); memset(&mgr->real_vertex_buffer[i], 0, sizeof(struct pipe_vertex_buffer));