From: Kenneth Graunke Date: Thu, 3 May 2018 05:26:03 +0000 (-0700) Subject: iris: fix 3DSTATE_VERTEX_ELEMENTS length X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02890c75b5c631a581435a663270c2a7ef7af8ee;p=mesa.git iris: fix 3DSTATE_VERTEX_ELEMENTS length --- 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];