From 394e1f5862a5cd537f60c01ed75dc698e112da58 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 19 Aug 2022 18:30:01 -0400 Subject: [PATCH] pan/bi: Don't allow ATEST to take a temporary Clause scheduler edition of db2bdc1dc37 ("pan/bi: Require ATEST coverage mask input in R60"). ATEST wants to read r60, which can't work if its input isn't even in a register. When per-sample shading isn't in use, prevents regressions in: KHR-GLES31.core.sample_variables.mask.* These tests previously passed because per-sample shading was forced. It's not clear whether the bug addressed in this patch is possible to hit "in the wild", i.e. without the optimizations in this series that allow us to use per-pixel shading in more cases. No shader-db changes. Signed-off-by: Alyssa Rosenzweig Cc: mesa-stable Part-of: --- src/panfrost/bifrost/bi_schedule.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index 8271beb2b64..e30b10fb8ad 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -630,6 +630,15 @@ bi_reads_temps(bi_instr *ins, unsigned src) case BI_OPCODE_CLPER_I32: case BI_OPCODE_CLPER_OLD_I32: return src != 0; + + /* ATEST isn't supposed to be restricted, but in practice it always + * wants to source its coverage mask input (source 0) from register 60, + * which won't work properly if we put the input in a temp. This + * requires workarounds in both RA and clause scheduling. + */ + case BI_OPCODE_ATEST: + return src != 0; + case BI_OPCODE_IMULD: return false; default: