lima: support indexed draw with bias
When doing an indexed draw with index_bias set to a non-zero value (e.g. by glDrawElementsBaseVertex), the vertex buffer should be offseted by index_bias vertices. Add this offset when setting the vertex buffer address. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
committed by
Vasily Khoruzhick
parent
f60ef0fff4
commit
8fa13db251
@@ -1154,7 +1154,7 @@ lima_update_gp_attribute_info(struct lima_context *ctx, const struct pipe_draw_i
|
||||
|
||||
lima_submit_add_bo(ctx->gp_submit, res->bo, LIMA_SUBMIT_BO_READ);
|
||||
|
||||
unsigned start = info->index_size ? ctx->min_index : info->start;
|
||||
unsigned start = info->index_size ? (ctx->min_index + info->index_bias) : info->start;
|
||||
attribute[n++] = res->bo->va + pvb->buffer_offset + pve->src_offset
|
||||
+ start * pvb->stride;
|
||||
attribute[n++] = (pvb->stride << 11) |
|
||||
|
||||
Reference in New Issue
Block a user