Thank you for the patch! Could you add a comment to include/panfrost_job.h explaining why this works?
Thanks, Alyssa On Thu, Jul 18, 2019 at 01:11:21PM +0200, Rohan Garg wrote: > Make sure we adjust draw_start and vertex_count in order to > take into account a index_bias as required by a glDrawElementsBaseVertex > call > > Signed-off-by: Rohan Garg <[email protected]> > --- > src/gallium/drivers/panfrost/pan_context.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/src/gallium/drivers/panfrost/pan_context.c > b/src/gallium/drivers/panfrost/pan_context.c > index 4bbf5230c6c..6484401e472 100644 > --- a/src/gallium/drivers/panfrost/pan_context.c > +++ b/src/gallium/drivers/panfrost/pan_context.c > @@ -1637,7 +1637,7 @@ panfrost_draw_vbo( > > ctx->payload_tiler.prefix.draw_mode = g2m_draw_mode(mode); > > - ctx->vertex_count = info->count; > + ctx->vertex_count = info->count + info->index_bias; > ctx->instance_count = info->instance_count; > > /* For non-indexed draws, they're the same */ > @@ -1686,14 +1686,13 @@ panfrost_draw_vbo( > > /* Use the corresponding values */ > vertex_count = max_index - min_index + 1; > - ctx->payload_vertex.draw_start = min_index; > - ctx->payload_tiler.draw_start = min_index; > + ctx->payload_vertex.draw_start = min_index + > info->index_bias; > + ctx->payload_tiler.draw_start = min_index + info->index_bias; > > ctx->payload_tiler.prefix.negative_start = -min_index; > ctx->payload_tiler.prefix.index_count = > MALI_POSITIVE(info->count); > > //assert(!info->restart_index); /* TODO: Research */ > - assert(!info->index_bias); > > draw_flags |= > panfrost_translate_index_size(info->index_size); > ctx->payload_tiler.prefix.indices = > panfrost_get_index_buffer_mapped(ctx, info); > -- > 2.17.1 >
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
