ac/nir/esgs: Don't emit ES outputs that aren't read by GS.

This is	necessary to prevent a regression from a future	commit,
in order to allow us to	map output locations differently.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29812>
This commit is contained in:
Timur Kristóf 2024-07-16 14:01:41 +02:00 committed by Marge Bot
parent 6d83389a39
commit ed6499db6b

View file

@ -150,6 +150,13 @@ lower_es_output_store(nir_builder *b,
}
lower_esgs_io_state *st = (lower_esgs_io_state *) state;
/* When an ES output isn't read by GS, don't emit anything. */
if ((io_sem.no_varying || !(st->gs_inputs_read & BITFIELD64_BIT(io_sem.location)))) {
nir_instr_remove(&intrin->instr);
return true;
}
const unsigned write_mask = nir_intrinsic_write_mask(intrin);
b->cursor = nir_before_instr(&intrin->instr);