From 02890c75b5c631a581435a663270c2a7ef7af8ee Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 2 May 2018 22:26:03 -0700 Subject: [PATCH] iris: fix 3DSTATE_VERTEX_ELEMENTS length --- src/gallium/drivers/iris/iris_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 18a6aca557d..2e6204395fc 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1419,7 +1419,8 @@ iris_create_vertex_elements(struct pipe_context *ctx, * - if those are necessary, use count + 1/2/3... OR in the length */ iris_pack_command(GENX(3DSTATE_VERTEX_ELEMENTS), cso->vertex_elements, ve) { - ve.DWordLength = 1 + GENX(VERTEX_ELEMENT_STATE_length) * count; + ve.DWordLength = + 1 + GENX(VERTEX_ELEMENT_STATE_length) * MAX2(count, 1) - 2; } uint32_t *ve_pack_dest = &cso->vertex_elements[1]; -- 2.30.2