From: Alyssa Rosenzweig Date: Mon, 8 Jun 2020 17:45:17 +0000 (-0400) Subject: panfrost: Emit unlinked varyings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c0217d945c558f0d21fcde2e761579e8b114433;p=mesa.git panfrost: Emit unlinked varyings Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5eab2b1fd66..fa82844ff1b 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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,