From 3c26fbc9348885ff8a85eaa2197bf1dd292ced98 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Fri, 9 Dec 2022 17:42:31 +0800 Subject: [PATCH] ac/nir/ngg: fix gs store output for no param offset slot when gfx11 When slot has no param offset, we should not emit store output for them on gfx11. Fixes: abe2e99e9e5 ("ac/nir/ngg: gs support 16bit outputs") Reviewed-by: Rhys Perry Signed-off-by: Qiang Yu Part-of: --- src/amd/common/ac_nir_lower_ngg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/amd/common/ac_nir_lower_ngg.c b/src/amd/common/ac_nir_lower_ngg.c index 26eaf4da3d3..3800fe42fa8 100644 --- a/src/amd/common/ac_nir_lower_ngg.c +++ b/src/amd/common/ac_nir_lower_ngg.c @@ -2832,10 +2832,7 @@ ngg_gs_export_vertices(nir_builder *b, nir_ssa_def *max_num_out_vtx, nir_ssa_def nir_ssa_def *val = nir_channel(b, load, i); unsigned comp = start + i; - if (output) { - /* low and high varyings have been packed when LDS store */ - output->chan[comp] = val; - } else { + if (s->options->gfx_level < GFX11) { if (mask_lo & BITFIELD_BIT(comp)) { nir_store_output(b, nir_unpack_32_2x16_split_x(b, val), nir_imm_int(b, 0), @@ -2854,6 +2851,10 @@ ngg_gs_export_vertices(nir_builder *b, nir_ssa_def *max_num_out_vtx, nir_ssa_def .write_mask = 1); } } + + /* low and high varyings have been packed when LDS store */ + if (output) + output->chan[comp] = val; } } }