diff options
author | Kenneth Graunke <[email protected]> | 2018-06-09 19:11:22 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:06 -0800 |
commit | 3eebea88dcb557faf7b161b13b082ad3d17f33ff (patch) | |
tree | 738dfbd45feda230292b11dac9c554044b209165 | |
parent | 92475461813df107ffa61e535219b80098d60bd5 (diff) |
iris: untested index buffer upload
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 93d1f32f459..d36a11d0aab 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2522,15 +2522,23 @@ iris_upload_render_state(struct iris_context *ice, } if (draw->index_size > 0) { - struct iris_resource *res = (struct iris_resource *)draw->index.resource; + struct iris_resource *res = NULL; + unsigned offset; - assert(!draw->has_user_indices); + if (draw->has_user_indices) { + u_upload_data(ice->ctx.stream_uploader, 0, + draw->count * draw->index_size, 4, draw->index.user, + &offset, (struct pipe_resource **) &res); + } else { + res = (struct iris_resource *) draw->index.resource; + offset = 0; + } iris_emit_cmd(batch, GENX(3DSTATE_INDEX_BUFFER), ib) { ib.IndexFormat = draw->index_size >> 1; ib.MOCS = MOCS_WB; ib.BufferSize = res->bo->size; - ib.BufferStartingAddress = ro_bo(res->bo, 0); + ib.BufferStartingAddress = ro_bo(res->bo, offset); } } |