Mesa (main): panfrost: Don't allocate empty varying buffer

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 1 19:26:48 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu May 20 14:10:25 2021 -0400

panfrost: Don't allocate empty varying buffer

If the FS doesn't actually read any varyings, there's no point.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11074>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index aaa84eea83a..dd8591e51fd 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -2280,9 +2280,11 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
                                         ctx->streamout.targets[i]);
         }
 
-        panfrost_emit_varyings(batch,
-                        &varyings[pan_varying_index(present, PAN_VARY_GENERAL)],
-                        stride, vertex_count);
+        if (stride) {
+                panfrost_emit_varyings(batch,
+                                &varyings[pan_varying_index(present, PAN_VARY_GENERAL)],
+                                stride, vertex_count);
+        }
 
         /* fp32 vec4 gl_Position */
         *position = panfrost_emit_varyings(batch,



More information about the mesa-commit mailing list