[Mesa-dev] [PATCH] panfrost: Take into account a index_bias for glDrawElementsBaseVertex calls
Alyssa Rosenzweig
alyssa.rosenzweig at collabora.com
Thu Jul 18 13:07:42 UTC 2019
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 <rohan.garg at collabora.com>
> ---
> 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190718/978b18db/attachment.sig>
More information about the mesa-dev
mailing list