nir_to_tgsi: Require the block index to always be populated

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: 74c02d99b2

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15640>
This commit is contained in:
Corentin Noël 2022-03-29 15:50:08 +02:00 committed by Marge Bot
parent 6cfde0abe9
commit f86bc873ff

View file

@ -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 = {