iris: fix 3DSTATE_VERTEX_ELEMENTS length
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 3 May 2018 05:26:03 +0000 (22:26 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:06 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 18a6aca557dc3450810b299640fc2b03a11df91e..2e6204395fc32a2814b351ae17b151b140646cb6 100644 (file)
@@ -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];