Mesa (staging/21.2): pan/mdg: Analyze helper termination after scheduling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 2 20:34:15 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 720645a5b36143f447e4dbadb1ba957ce5c88dd0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=720645a5b36143f447e4dbadb1ba957ce5c88dd0

Author: Icecream95 <ixn at disroot.org>
Date:   Thu Jul 22 20:17:31 2021 +1200

pan/mdg: Analyze helper termination after scheduling

Similar to the fix in 6bf8e960faa ("pan/bi: Do helper termination
analysis on clauses")

Though apparently a "theoretical issue only", fixes artefacts in
DarkPlaces with both D3D9 and GL renderers.

Fixes: 9a7f0e268b7 ("pan/mdg: Use the helper invo analyze passes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12156>
(cherry picked from commit a2b37e95926f52b597dd0cf440092bd296efa434)

---

 .pick_status.json                                   | 2 +-
 src/gallium/drivers/panfrost/ci/traces-panfrost.yml | 6 +++---
 src/panfrost/midgard/midgard_compile.c              | 4 +++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index d849925c482..bbc10db2537 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -265,7 +265,7 @@
         "description": "pan/mdg: Analyze helper termination after scheduling",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "9a7f0e268b7baeb92d8d7d2989beb43550262406"
     },
diff --git a/src/gallium/drivers/panfrost/ci/traces-panfrost.yml b/src/gallium/drivers/panfrost/ci/traces-panfrost.yml
index 3d439648625..a75dea3d6ee 100644
--- a/src/gallium/drivers/panfrost/ci/traces-panfrost.yml
+++ b/src/gallium/drivers/panfrost/ci/traces-panfrost.yml
@@ -45,7 +45,7 @@ traces:
   - path: gputest/furmark.trace
     expectations:
       - device: gl-panfrost-t860
-        checksum: 2bde9efdddd92c28d29f744e36a226e9
+        checksum: 6540f71b1c051ba82af2a25b93065f34
   - path: gputest/triangle.trace
     expectations:
       - device: gl-panfrost-t860
@@ -55,7 +55,7 @@ traces:
   - path: humus/Portals.trace
     expectations:
       - device: gl-panfrost-t860
-        checksum: f83da726bff354684a576effa74ef681
+        checksum: ad04db74ea70b7772719080f8a4c499b
       - device: gl-panfrost-t760
         # Wrong rendering, many elements are missing
         checksum: 67db7302b28cb8e3e217cc79b672af79
@@ -213,7 +213,7 @@ traces:
   - path: humus/AmbientAperture.trace
     expectations:
       - device: gl-panfrost-t860
-        checksum: 20492edd94ea94ba73013a4ee14285b7
+        checksum: e4c0b930ef99f14305e1ade7f1779c09
   - path: humus/CelShading.trace
     expectations:
       - device: gl-panfrost-t860
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index a8dc872d31b..183e2991497 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -3173,13 +3173,15 @@ midgard_compile_shader_nir(nir_shader *nir,
 
         /* Analyze now that the code is known but before scheduling creates
          * pipeline registers which are harder to track */
-        mir_analyze_helper_terminate(ctx);
         mir_analyze_helper_requirements(ctx);
 
         /* Schedule! */
         midgard_schedule_program(ctx);
         mir_ra(ctx);
 
+        /* Analyze after scheduling since this is order-dependent */
+        mir_analyze_helper_terminate(ctx);
+
         /* Emit flat binary from the instruction arrays. Iterate each block in
          * sequence. Save instruction boundaries such that lookahead tags can
          * be assigned easily */



More information about the mesa-commit mailing list