diff options
author | Rob Clark <[email protected]> | 2018-01-29 09:54:07 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-02-10 14:54:58 -0500 |
commit | 55f14a1ac4553eb14656540404cf9a6a9abc34fc (patch) | |
tree | cf4fa3efb9396fde0a3d55046213147ef7cd3755 | |
parent | 5a7de943927b16fc9142d31f22b815c3e19e96ea (diff) |
freedreno/ir3: make block/instruction serialno per-shader
Makes it easier to compare values seen in-game (where there are many
shaders) to cmdline standalone compiler.
Signed-off-by: Rob Clark <[email protected]>
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c b/src/gallium/drivers/freedreno/ir3/ir3.c index 04c02340940..dd5fb2fbbe5 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.c +++ b/src/gallium/drivers/freedreno/ir3/ir3.c @@ -745,8 +745,7 @@ static void insert_instr(struct ir3_block *block, { struct ir3 *shader = block->shader; #ifdef DEBUG - static uint32_t serialno = 0; - instr->serialno = ++serialno; + instr->serialno = ++shader->instr_count; #endif list_addtail(&instr->node, &block->instr_list); @@ -758,8 +757,7 @@ struct ir3_block * ir3_block_create(struct ir3 *shader) { struct ir3_block *block = ir3_alloc(shader, sizeof(*block)); #ifdef DEBUG - static uint32_t serialno = 0; - block->serialno = ++serialno; + block->serialno = ++shader->block_count; #endif block->shader = shader; list_inithead(&block->node); diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h index 84235cc1cd2..781a660bff8 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.h +++ b/src/gallium/drivers/freedreno/ir3/ir3.h @@ -444,6 +444,10 @@ struct ir3 { /* List of ir3_array's: */ struct list_head array_list; + +#ifdef DEBUG + unsigned block_count, instr_count; +#endif }; typedef struct nir_register nir_register; |