From 24101d944b70b45913f6d1bee40daa76f72f5457 Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Wed, 23 Feb 2022 23:16:35 +1300 Subject: [PATCH] pan/bi: Add documentation for bifrost_nir_lower_store_component Taken from the commit that introduced the function, 95458c40330 ("pan/bi: Lower stores with component != 0"). Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 19ffb116530..d2c37e73bdd 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -3742,6 +3742,10 @@ bi_opt_post_ra(bi_context *ctx) } } +/* If the shader packs multiple varyings into the same location with different + * location_frac, we'll need to lower to a single varying store that collects + * all of the channels together. + */ static bool bifrost_nir_lower_store_component(struct nir_builder *b, nir_instr *instr, void *data) @@ -3785,7 +3789,7 @@ bifrost_nir_lower_store_component(struct nir_builder *b, } intr->num_components = util_last_bit(mask); - nir_instr_rewrite_src_ssa(instr, &intr->src[0], + nir_instr_rewrite_src_ssa(instr, &intr->src[0], nir_vec(b, channels, intr->num_components)); nir_intrinsic_set_component(intr, 0);