From 9c8f7c481fbbb941fbb8936346d0be4df240fdb5 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 26 May 2026 20:09:26 -0700 Subject: [PATCH] brw: Fold constants after nir_lower_io for VS/GS/TES outputs brw_nir_lower_deferred_urb_writes assumes that constant offsets will be properly folded. In brw itself we call the big optimization loop which takes care of this, but jay doesn't do that in-between. At any rate, nir_lower_io generates a lot of address math that really ought to get cleaned up, so it seems like a good point to call it here. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/brw/brw_nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/compiler/brw/brw_nir.c b/src/intel/compiler/brw/brw_nir.c index b6bf1ba5034..2d72d8c2931 100644 --- a/src/intel/compiler/brw/brw_nir.c +++ b/src/intel/compiler/brw/brw_nir.c @@ -1754,6 +1754,9 @@ brw_nir_lower_vue_outputs(nir_shader *nir) nir_lower_io_lower_64bit_to_32); NIR_PASS(_, nir, brw_nir_lower_16bit_io, nir_var_shader_out); + + /* Fold constant offset srcs for IO. */ + NIR_PASS(_, nir, nir_opt_constant_folding); } void