iris: fix VF instancing length so we don't get garbage in batch
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 22 Jan 2018 05:09:30 +0000 (21:09 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 9ccc37fd982b5afd2fd93abf117b04b5ad262a22..4e506b5431ed79ef806cbb8f3afef07e8b3ba74b 100644 (file)
@@ -1498,8 +1498,8 @@ iris_upload_render_state(struct iris_context *ice,
       iris_batch_emit(batch, cso->vertex_elements, sizeof(uint32_t) *
                       (1 + cso->count * GENX(VERTEX_ELEMENT_STATE_length)));
       for (int i = 0; i < cso->count; i++) {
-         iris_batch_emit(batch, cso->vf_instancing[i],
-                         sizeof(cso->vf_instancing[0]));
+         iris_batch_emit(batch, cso->vf_instancing[i], sizeof(uint32_t) *
+                         (cso->count * GENX(3DSTATE_VF_INSTANCING_length)));
       }
       for (int i = 0; i < cso->count; i++) {
          /* TODO: vertexid, instanceid support */