pan/bi: Don't allow ATEST to take a temporary

Clause scheduler edition of db2bdc1dc3 ("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 <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17841>
(cherry picked from commit 394e1f5862)
This commit is contained in:
Alyssa Rosenzweig
2022-08-19 18:30:01 -04:00
committed by Dylan Baker
parent 8c64dc4873
commit 90ab3994de
2 changed files with 10 additions and 1 deletions

View File

@@ -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
},

View File

@@ -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: