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: 659b7eb279 ("r600: better tracking for vertex buffer emission")

v2: use element size instead of type size (Vitaly)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37856>
This commit is contained in:
Gert Wollny 2025-10-13 23:42:19 +02:00 committed by Marge Bot
parent 49226692e5
commit 673351bbf3

View file

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