From 3290222a1a56169c5187e85e0ce61b3da861a820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 16 Jan 2025 02:02:45 -0500 Subject: [PATCH] st/mesa: move VS & TES output stores to the end before unlowering IO required by vc4 & vc5 Acked-by: Iago Toral Quiroga Part-of: --- src/mesa/state_tracker/st_program.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 182cb925014..77fac642ed3 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -863,6 +863,12 @@ st_create_common_variant(struct st_context *st, * are still counted as enabled IO, which breaks things. */ NIR_PASS(_, state.ir.nir, nir_opt_dce); + + /* vc4, vc5 require this. */ + if (state.ir.nir->info.stage == MESA_SHADER_VERTEX || + state.ir.nir->info.stage == MESA_SHADER_TESS_EVAL) + NIR_PASS(_, state.ir.nir, nir_move_output_stores_to_end); + NIR_PASS(_, state.ir.nir, st_nir_unlower_io_to_vars); if (state.ir.nir->info.stage == MESA_SHADER_TESS_CTRL &&