From f86bc873ffc23bb5d33c7acc1a5c0578abc5b30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Tue, 29 Mar 2022 15:50:08 +0200 Subject: [PATCH] nir_to_tgsi: Require the block index to always be populated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases like when using `NIR_DEBUG=serialize`, impl->num_blocks is 0 which leads to assertions error in the blocklist. Make sure to require the num_blocks to be populated. Fixes: 74c02d99b224fbc02132b54bf23e6ac1e117d805 Signed-off-by: Corentin Noël Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index 76ce2de7e45..b3bb405d18f 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -355,6 +355,8 @@ ntt_live_reg_setup_def_use(struct ntt_compile *c, nir_function_impl *impl, struc static void ntt_live_regs(struct ntt_compile *c, nir_function_impl *impl) { + nir_metadata_require(impl, nir_metadata_block_index); + c->liveness = rzalloc_array(c, struct ntt_reg_interval, c->num_temps); struct ntt_live_reg_state state = {