panfrost: Use pack for general varying
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 14 Aug 2020 19:23:10 +0000 (15:23 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Aug 2020 11:43:52 +0000 (11:43 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>

src/gallium/drivers/panfrost/pan_cmdstream.c

index b2268faf9bb99c89f0d5bfa0d3cf00b51e4cc43c..376705fc844ceec6963debf1d2bb978dce500165 100644 (file)
@@ -1715,14 +1715,12 @@ pan_emit_vary(struct mali_attribute_packed *out,
                         panfrost_get_default_swizzle(nr_channels) :
                         panfrost_bifrost_swizzle(nr_channels);
 
-        struct mali_attr_meta meta = {
-                .index = pan_varying_index(present, buf),
-                .unknown1 = quirks & IS_BIFROST ? 0x0 : 0x2,
-                .format = (format << 12) | swizzle,
-                .src_offset = offset
-        };
-
-        memcpy(out, &meta, sizeof(meta));
+        pan_pack(out, ATTRIBUTE, cfg) {
+                cfg.buffer_index = pan_varying_index(present, buf);
+                cfg.unknown = quirks & IS_BIFROST ? 0x0 : 0x1;
+                cfg.format = (format << 12) | swizzle;
+                cfg.offset = offset;
+        }
 }
 
 /* General varying that is unused */