From ed29a2beb80e53e6a9985786c77350d963e860e7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 16 Feb 2021 21:16:26 -0500 Subject: [PATCH] pan/bi: Use explicit move even for RT#0 of MRT Otherwise we get a bad RA if RT 0 = RT 3 (for example), fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_literal.fragment.sampler2d Fixes: a6f1500bedd ("pan/bi: Workaround BLEND precolour with explicit moves") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 3dae19c..50782fb 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -507,7 +507,12 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr) /* Explicit copy since BLEND inputs are precoloured to R0-R3, * TODO: maybe schedule around this or implement in RA as a * spill */ - if (rt > 0) { + bool has_mrt = false; + + nir_foreach_shader_out_variable(var, b->shader->nir) + has_mrt |= (var->data.location > FRAG_RESULT_DATA0); + + if (has_mrt) { bi_index srcs[4] = { color, color, color, color }; unsigned channels[4] = { 0, 1, 2, 3 }; color = bi_temp(b->shader); -- 2.7.4