freedreno/ir3: make block/instruction serialno per-shader
authorRob Clark <robdclark@gmail.com>
Mon, 29 Jan 2018 14:54:07 +0000 (09:54 -0500)
committerRob Clark <robdclark@gmail.com>
Sat, 10 Feb 2018 19:54:58 +0000 (14:54 -0500)
Makes it easier to compare values seen in-game (where there are many
shaders) to cmdline standalone compiler.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3.c
src/gallium/drivers/freedreno/ir3/ir3.h

index 04c02340940e61e9702df4bfafcc0d1d96d19200..dd5fb2fbbe5ae483d5cb69f7601233883cf80d03 100644 (file)
@@ -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);
index 84235cc1cd2722ac7fa953849740a7de224746e6..781a660bff855c94ce7ef8c3939794d3994c1ade 100644 (file)
@@ -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;