pan/bi: Count blocks

For u_worklist.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16279>
This commit is contained in:
Alyssa Rosenzweig 2022-04-19 14:00:01 -04:00 committed by Marge Bot
parent eb0001bf2b
commit d496fe153a
3 changed files with 4 additions and 5 deletions

View File

@ -37,6 +37,7 @@ bit_builder(void *memctx)
{
bi_context *ctx = rzalloc(memctx, bi_context);
list_inithead(&ctx->blocks);
ctx->num_blocks = 1;
bi_block *blk = rzalloc(ctx, bi_block);

View File

@ -4555,12 +4555,9 @@ bi_compile_variant_nir(nir_shader *nir,
break; /* TODO: Multi-function shaders */
}
unsigned block_source_count = 0;
/* Index blocks now that we're done emitting */
bi_foreach_block(ctx, block) {
/* Name blocks now that we're done emitting so the order is
* consistent */
block->index = block_source_count++;
block->index = ctx->num_blocks++;
}
bi_validate(ctx, "NIR -> BIR");

View File

@ -731,6 +731,7 @@ typedef struct {
uint32_t quirks;
unsigned arch;
enum bi_idvs_mode idvs;
unsigned num_blocks;
/* In any graphics shader, whether the "IDVS with memory
* allocation" flow is used. This affects how varyings are loaded and