From: Alyssa Rosenzweig Date: Fri, 14 Aug 2020 19:21:20 +0000 (-0400) Subject: panfrost: Use pack for XFB varying X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c850637f5a988ce92c1dd22809229a1d2c22d37;p=mesa.git panfrost: Use pack for XFB varying Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 34568a46506..b2268faf9bb 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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