summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2017-01-31 20:15:53 +0100
committerChristian Gmeiner <[email protected]>2017-02-11 21:22:48 +0100
commit7256ed3c7967a1fc2a4f9ad23377ef4fe458095f (patch)
tree688e0868083d674a8bb72825609bd3633b69c290 /src
parent5a3ea68895f7815ccb5b3adeab07c992683c2d59 (diff)
etnaviv: keep track of emitted loops
Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_compiler.c6
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_compiler.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index 7446a1970b2..af7b64d0ad1 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -183,6 +183,8 @@ struct etna_compile {
unsigned labels_count, labels_sz;
struct etna_compile_label *labels;
+ unsigned num_loops;
+
/* Code generation */
int inst_ptr; /* current instruction pointer */
uint32_t code[ETNA_MAX_INSTRUCTIONS * ETNA_INST_SIZE];
@@ -1166,6 +1168,8 @@ trans_loop_bgn(const struct instr_translater *t, struct etna_compile *c,
f->lbl_loop_end = alloc_new_label(c);
label_place(c, f->lbl_loop_bgn);
+
+ c->num_loops++;
}
static void
@@ -2418,6 +2422,7 @@ etna_compile_shader(const struct etna_specs *specs,
shader->processor = c->info.processor;
shader->code_size = c->inst_ptr * 4;
shader->code = mem_dup(c->code, c->inst_ptr * 16);
+ shader->num_loops = c->num_loops;
shader->num_temps = c->next_free_native;
shader->vs_pos_out_reg = -1;
shader->vs_pointsize_out_reg = -1;
@@ -2455,6 +2460,7 @@ etna_dump_shader(const struct etna_shader *shader)
etna_disasm(shader->code, shader->code_size, PRINT_RAW);
+ printf("num loops: %i\n", shader->num_loops);
printf("num temps: %i\n", shader->num_temps);
printf("num const: %i\n", shader->uniforms.const_count);
printf("immediates:\n");
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.h b/src/gallium/drivers/etnaviv/etnaviv_compiler.h
index d3101096f98..211ae1abdfe 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.h
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.h
@@ -59,6 +59,7 @@ struct etna_shader {
uint processor; /* TGSI_PROCESSOR_... */
uint32_t code_size; /* code size in uint32 words */
uint32_t *code;
+ unsigned num_loops;
unsigned num_temps;
struct etna_shader_uniform_info uniforms;