Mesa (master): lima: support indexed draw with bias

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 31 22:24:07 UTC 2019


Module: Mesa
Branch: master
Commit: 8fa13db25163d36460d779dd4ea0ede19227cdbf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8fa13db25163d36460d779dd4ea0ede19227cdbf

Author: Icenowy Zheng <icenowy at aosc.io>
Date:   Tue Oct 22 22:14:56 2019 +0800

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 at aosc.io>
Reviewed-by: Vasily Khoruzhick <anarsoul at gmail.com>

---

 src/gallium/drivers/lima/lima_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c
index 9753343409e..a607e874601 100644
--- a/src/gallium/drivers/lima/lima_draw.c
+++ b/src/gallium/drivers/lima/lima_draw.c
@@ -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) |




More information about the mesa-commit mailing list