From: Kenneth Graunke Date: Sat, 20 Jan 2018 09:07:41 +0000 (-0800) Subject: iris: fix bogus index buffer reference X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fad62cef10ad07d27f00e294302b5ac026f6458;p=mesa.git iris: fix bogus index buffer reference --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index bfca3fb75cb..1ec34bddbcb 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1445,7 +1445,7 @@ iris_upload_render_state(struct iris_context *ice, } // draw->index_size > 0 - if (1) { + if (draw->index_size > 0) { struct iris_resource *res = (struct iris_resource *)draw->index.resource; assert(!draw->has_user_indices); @@ -1457,24 +1457,24 @@ iris_upload_render_state(struct iris_context *ice, // XXX: gah, addresses :( need two different combine address funcs // ib.BufferStartingAddress = res->bo; } + } - assert(!draw->indirect); // XXX: indirect support - - iris_emit_cmd(batch, GENX(3DPRIMITIVE), prim) { - prim.StartInstanceLocation = draw->start_instance; - prim.InstanceCount = draw->instance_count; + assert(!draw->indirect); // XXX: indirect support - // XXX: this is probably bonkers. - prim.StartVertexLocation = draw->start; + iris_emit_cmd(batch, GENX(3DPRIMITIVE), prim) { + prim.StartInstanceLocation = draw->start_instance; + prim.InstanceCount = draw->instance_count; - if (draw->index_size) { - prim.BaseVertexLocation += draw->index_bias; - } else { - prim.StartVertexLocation += draw->index_bias; - } + // XXX: this is probably bonkers. + prim.StartVertexLocation = draw->start; - //prim.BaseVertexLocation = ...; + if (draw->index_size) { + prim.BaseVertexLocation += draw->index_bias; + } else { + prim.StartVertexLocation += draw->index_bias; } + + //prim.BaseVertexLocation = ...; } #if 0 l3 configuration