From 90ab3994de050f6d8f165b44406be3ffb5ab280e 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: (cherry picked from commit 394e1f5862a5cd537f60c01ed75dc698e112da58) --- .pick_status.json | 2 +- src/panfrost/bifrost/bi_schedule.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 4f0e3bef45c..055eaae809d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -12829,7 +12829,7 @@ "description": "pan/bi: Don't allow ATEST to take a temporary", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, 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: