diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-02-03 08:19:41 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-05 15:41:55 +0000 |
commit | 7eaf21cb6f67adbe0e79b80b4feb8c816a98a720 (patch) | |
tree | 9d7acb2c67b54dc1780b228b4644faffc92e11a5 /src/panfrost | |
parent | 38c20696a5358d6898c4ee96fb127d603c1e1404 (diff) |
pan/midgard: Fix scheduling issue with csel + render target reference
Fixes dEQP-GLES3.functional.shaders.fragdepth.write.dynamic_conditional_write
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 1697f086390..84a4281f7ff 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -858,6 +858,24 @@ mir_schedule_alu( unreachable("Bad condition"); } + /* If we have a render target reference, schedule a move for it. Since + * this will be in sadd, we boost this to prevent scheduling csel into + * smul */ + + if (writeout && (branch->constants.u32[0] || ctx->is_blend)) { + sadd = ralloc(ctx, midgard_instruction); + *sadd = v_mov(~0, make_compiler_temp(ctx)); + sadd->unit = UNIT_SADD; + sadd->mask = 0x1; + sadd->has_inline_constant = true; + sadd->inline_constant = branch->constants.u32[0]; + branch->src[1] = sadd->dest; + + /* Mask off any conditionals. Could be optimized to just scalar + * conditionals TODO */ + predicate.no_cond = true; + } + mir_choose_alu(&smul, instructions, worklist, len, &predicate, UNIT_SMUL); if (!writeout) { @@ -913,18 +931,6 @@ mir_schedule_alu( unreachable("Bad condition"); } - /* If we have a render target reference, schedule a move for it */ - - if (writeout && (branch->constants.u32[0] || ctx->is_blend)) { - sadd = ralloc(ctx, midgard_instruction); - *sadd = v_mov(~0, make_compiler_temp(ctx)); - sadd->unit = UNIT_SADD; - sadd->mask = 0x1; - sadd->has_inline_constant = true; - sadd->inline_constant = branch->constants.u32[0]; - branch->src[1] = sadd->dest; - } - /* Stage 2, let's schedule sadd before vmul for writeout */ mir_choose_alu(&sadd, instructions, worklist, len, &predicate, UNIT_SADD); |