panfrost: Emit unlinked varyings
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 8 Jun 2020 17:45:17 +0000 (13:45 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Jun 2020 14:45:50 +0000 (14:45 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5423>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 5eab2b1fd66f56fe329a0beb92e25b68bf040480..fa82844ff1b3da932c6a7a7d73a4870e5fb651c2 100644 (file)
@@ -1836,6 +1836,36 @@ pan_varying_present(
         return present;
 }
 
+/* Emitters for varying records */
+
+static struct mali_attr_meta
+pan_emit_vary(unsigned present, enum pan_special_varying buf,
+                unsigned quirks, enum mali_format format,
+                unsigned offset)
+{
+        unsigned nr_channels = MALI_EXTRACT_CHANNELS(format);
+
+        struct mali_attr_meta meta = {
+                .index = pan_varying_index(present, buf),
+                .unknown1 = quirks & IS_BIFROST ? 0x0 : 0x2,
+                .swizzle = quirks & HAS_SWIZZLES ?
+                        panfrost_get_default_swizzle(nr_channels) :
+                        panfrost_bifrost_swizzle(nr_channels),
+                .format = format,
+                .src_offset = offset
+        };
+
+        return meta;
+}
+
+/* General varying that is unused */
+
+static struct mali_attr_meta
+pan_emit_vary_only(unsigned present, unsigned quirks)
+{
+        return pan_emit_vary(present, 0, quirks, MALI_VARYING_DISCARD, 0);
+}
+
 void
 panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
                                  unsigned vertex_count,