From c2a9dd693b3f41edc370af36301866705c50fd1c Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 20 Mar 2023 14:09:22 -0700 Subject: [PATCH] nir_to_tgsi: Handle stores to compact outputs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We had been relying on glsl lowering to a vec4 output, but we can just do a tiny override here to support compact variables and drop the lowering pass. Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 5b25c2196dd..38b9bc6d8e4 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -722,13 +722,22 @@ ntt_output_decl(struct ntt_compile *c, nir_intrinsic_instr *instr, uint32_t *fra */ bool invariant = semantics.invariant; + unsigned num_slots = semantics.num_slots; + if (semantics.location == VARYING_SLOT_TESS_LEVEL_INNER || + semantics.location == VARYING_SLOT_TESS_LEVEL_OUTER) { + /* Compact vars get a num_slots in NIR as number of components, but we + * want the number of vec4 slots here. + */ + num_slots = 1; + } + out = ureg_DECL_output_layout(c->ureg, semantic_name, semantic_index, gs_streams, base, usage_mask, array_id, - semantics.num_slots, + num_slots, invariant); }