From 673351bbf32e87349a926380bc65afd233a068ef Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 13 Oct 2025 23:42:19 +0200 Subject: [PATCH] r600: Fix comparison of strides array when emitting vertex buffers The comparison was only comparing a number of bytes where we actually have to compare a number of dwords (Thanks QuadShader for digging into this) Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14067 Fixes: 659b7eb2799 ("r600: better tracking for vertex buffer emission") v2: use element size instead of type size (Vitaly) Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/r600_state_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 708c777c3e7..06845b85238 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -564,7 +564,9 @@ static void r600_bind_vertex_elements(struct pipe_context *ctx, void *state) r600_set_cso_state(rctx, &rctx->vertex_fetch_shader, state); if (!prev || (cso && cso->buffer_mask && - (prev->buffer_mask != cso->buffer_mask || memcmp(cso->strides, prev->strides, util_last_bit(cso->buffer_mask))))) { + (prev->buffer_mask != cso->buffer_mask || + memcmp(cso->strides, prev->strides, + util_last_bit(cso->buffer_mask) * sizeof(cso->strides[0]))))) { rctx->vertex_buffer_state.dirty_mask |= cso ? cso->buffer_mask : 0; r600_vertex_buffers_dirty(rctx); }