panfrost: Use pack for XFB varying
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 14 Aug 2020 19:21:20 +0000 (15:21 -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 34568a46506b01ba5e2e5e46330847c0397bfca1..b2268faf9bb99c89f0d5bfa0d3cf00b51e4cc43c 100644 (file)
@@ -1779,23 +1779,18 @@ pan_emit_vary_xfb(struct mali_attribute_packed *out,
                         panfrost_get_default_swizzle(o.num_components) :
                         panfrost_bifrost_swizzle(o.num_components);
 
-        /* Otherwise construct a record for it */
-        struct mali_attr_meta meta = {
+        pan_pack(out, ATTRIBUTE, cfg) {
                 /* XFB buffers come after everything else */
-                .index = pan_xfb_base(present) + o.output_buffer,
-
-                /* As usual unknown bit */
-                .unknown1 = quirks & IS_BIFROST ? 0x0 : 0x2,
+                cfg.buffer_index = pan_xfb_base(present) + o.output_buffer;
+                cfg.unknown = quirks & IS_BIFROST ? 0x0 : 0x1;
 
                 /* Override number of channels and precision to highp */
-                .format = (pan_xfb_format(format, o.num_components) << 12) | swizzle,
+                cfg.format = (pan_xfb_format(format, o.num_components) << 12) | swizzle;
 
                 /* Apply given offsets together */
-                .src_offset = (o.dst_offset * 4) /* dwords */
-                        + streamout_offsets[o.output_buffer]
-        };
-
-        memcpy(out, &meta, sizeof(meta));
+                cfg.offset = (o.dst_offset * 4) /* dwords */
+                        + streamout_offsets[o.output_buffer];
+        }
 }
 
 /* Determine if we should capture a varying for XFB. This requires actually