aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-11-23 21:44:16 -0500
committerTomeu Vizoso <[email protected]>2019-12-16 09:10:33 +0000
commita2d5503b68ab54055bad2592aff7cbe193c2345b (patch)
tree2d91c7b0955fa69416520e12486fcec409e71267 /src/panfrost
parent2c1983aefeb6dacfbc61f9edd71975ea359fae40 (diff)
panfrost: Pass blend RT number through
We have to key the blend shader for the render target number due to writeout silliness. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Visoso <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/midgard/compiler.h3
-rw-r--r--src/panfrost/midgard/midgard_compile.c7
-rw-r--r--src/panfrost/midgard/midgard_compile.h2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index faeecf0150c..d087579f36d 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -224,6 +224,9 @@ typedef struct compiler_context {
/* Is internally a blend shader? Depends on stage == FRAGMENT */
bool is_blend;
+ /* Render target number for a keyed blend shader. Depends on is_blend */
+ unsigned blend_rt;
+
/* Tracking for blend constant patching */
int blend_constant_offset;
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 6575771edf7..5b018d86e50 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1607,9 +1607,9 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
splatter.swizzle[1][c] = 0;
emit_mir_instruction(ctx, splatter);
- emit_fragment_store(ctx, expanded, 0);
+ emit_fragment_store(ctx, expanded, ctx->blend_rt);
} else
- emit_fragment_store(ctx, reg, 0);
+ emit_fragment_store(ctx, reg, ctx->blend_rt);
break;
@@ -2433,7 +2433,7 @@ midgard_get_first_tag_from_block(compiler_context *ctx, unsigned block_idx)
}
int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned gpu_id)
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id)
{
struct util_dynarray *compiled = &program->compiled;
@@ -2446,6 +2446,7 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
ctx->stage = nir->info.stage;
ctx->is_blend = is_blend;
ctx->alpha_ref = program->alpha_ref;
+ ctx->blend_rt = blend_rt;
ctx->quirks = midgard_get_quirks(gpu_id);
/* Start off with a safe cutoff, allowing usage of all 16 work
diff --git a/src/panfrost/midgard/midgard_compile.h b/src/panfrost/midgard/midgard_compile.h
index ffdaa89d129..9d27c338f4b 100644
--- a/src/panfrost/midgard/midgard_compile.h
+++ b/src/panfrost/midgard/midgard_compile.h
@@ -91,7 +91,7 @@ typedef struct {
} midgard_program;
int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned gpu_id);
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id);
/* NIR options are shared between the standalone compiler and the online
* compiler. Defining it here is the simplest, though maybe not the Right