iris: fix VBs
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 22 Jan 2018 04:10:57 +0000 (20:10 -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 41754ce260ad1ba19594a098014853ba1cec1eea..e8f8173303fba204c1d42f9d336e0d4b87736b0a 100644 (file)
@@ -1475,11 +1475,12 @@ iris_upload_render_state(struct iris_context *ice,
       struct iris_vertex_buffer_state *cso = ice->state.cso_vertex_buffers;
 
       STATIC_ASSERT(GENX(VERTEX_BUFFER_STATE_length) == 4);
+      STATIC_ASSERT((GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) % 32) == 0);
 
       uint64_t *addr = batch->cmdbuf.map_next + sizeof(uint32_t) *
-         (1 + GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) % 32);
+         (1 + GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) / 32);
       uint32_t *delta = cso->vertex_buffers +
-         (2 + GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) % 32);
+         (2 + GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) / 32);
 
       iris_batch_emit(batch, cso->vertex_buffers,
                       sizeof(uint32_t) * (1 + 4 * cso->num_buffers));