panfrost: Don't allocate empty varying buffer
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 20 May 2021 18:10:25 +0000 (14:10 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Jun 2021 19:10:28 +0000 (19:10 +0000)
If the FS doesn't actually read any varyings, there's no point.

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

src/gallium/drivers/panfrost/pan_cmdstream.c

index aaa84ee..dd8591e 100644 (file)
@@ -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,