From c87629771d5396f99abcb4f262913720395a4c68 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 4 Jun 2022 09:58:40 -0400 Subject: [PATCH] panfrost: Don't calculate min/max indices on v9 On Valhall, we always* use memory-allocated IDVS, which does not require min/max indices. As such, we do not want to calculate min/max indices, as this is quite slow. Skip this step. * except for blit shaders, which don't use an index buffer anyway. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5ddc31f7765..d9cc9535e65 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -3682,7 +3682,9 @@ panfrost_direct_draw(struct panfrost_batch *batch, unsigned min_index = 0, max_index = 0; mali_ptr indices = 0; - if (info->index_size) { + if (info->index_size && PAN_ARCH >= 9) { + indices = panfrost_get_index_buffer(batch, info, draw); + } else if (info->index_size) { indices = panfrost_get_index_buffer_bounded(batch, info, draw, &min_index, &max_index);