diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-08-30 13:57:20 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2019-08-30 15:50:26 -0700 |
commit | 19bceb5812cf3056c1b5ffb3c372d3f8b9872e26 (patch) | |
tree | 6c79651d3df470f40e6853126937fa5243f7586f /src/panfrost/midgard | |
parent | 72cbd2d4e77c782fa67b96ab12e2d2ed60cc7fb7 (diff) | |
download | mesa-19bceb5812cf3056c1b5ffb3c372d3f8b9872e26.tar.gz |
pan/midgard: Track shader quadword count while scheduling
This allow multiblock blend shaders to compute constant colour offsets
correctly.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 2 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 6 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 201999359cf..b63a542e5ad 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -280,6 +280,8 @@ typedef struct compiler_context { /* Alpha ref value passed in */ float alpha_ref; + unsigned quadword_count; + /* The mapping of sysvals to uniforms, the count, and the off-by-one inverse */ unsigned sysvals[MAX_SYSVAL_COUNT]; unsigned sysval_count; diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 765eab36d86..6317e886dcc 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2807,7 +2807,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga disassemble_midgard(program->compiled.data, program->compiled.size); if (midgard_debug & MIDGARD_DBG_SHADERDB) { - unsigned nr_bundles = 0, nr_ins = 0, nr_quadwords = 0; + unsigned nr_bundles = 0, nr_ins = 0; /* Count instructions and bundles */ @@ -2815,8 +2815,6 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga nr_bundles += util_dynarray_num_elements( &block->bundles, midgard_bundle); - nr_quadwords += block->quadword_count; - mir_foreach_bundle_in_block(block, bun) nr_ins += bun->instruction_count; } @@ -2839,7 +2837,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga "%d:%d spills:fills\n", SHADER_DB_COUNT++, gl_shader_stage_name(ctx->stage), - nr_ins, nr_bundles, nr_quadwords, + nr_ins, nr_bundles, ctx->quadword_count, nr_registers, nr_threads, ctx->loop_count, ctx->spills, ctx->fills); diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 98d5f1b03f7..7b687766491 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -630,9 +630,8 @@ schedule_block(compiler_context *ctx, midgard_block *block) util_dynarray_append(&block->bundles, midgard_bundle, bundle); if (bundle.has_blend_constant) { - /* TODO: Multiblock? */ - int quadwords_within_block = block->quadword_count + quadword_size(bundle.tag) - 1; - ctx->blend_constant_offset = quadwords_within_block * 0x10; + unsigned offset = ctx->quadword_count + block->quadword_count + quadword_size(bundle.tag) - 1; + ctx->blend_constant_offset = offset * 0x10; } while(skip--) @@ -642,6 +641,7 @@ schedule_block(compiler_context *ctx, midgard_block *block) } block->is_scheduled = true; + ctx->quadword_count += block->quadword_count; } /* The following passes reorder MIR instructions to enable better scheduling */ |