util/vbuf: stop nooping set_vertex_buffers calls
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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: 1638d486ff ("gallium/u_threaded,st/mesa: add a merged set_vertex_elements_and_buffers call")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37277>
This commit is contained in:
Mike Blumenkrantz 2025-09-09 10:50:09 -04:00 committed by Marge Bot
parent d63374498d
commit cccca8d140

View file

@ -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));