Mesa (main): panfrost: Don't calculate min/max indices on v9

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 6 15:12:28 UTC 2022


Module: Mesa
Branch: main
Commit: c87629771d5396f99abcb4f262913720395a4c68
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c87629771d5396f99abcb4f262913720395a4c68

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Sat Jun  4 09:58:40 2022 -0400

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 <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16867>

---

 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);



More information about the mesa-commit mailing list