Mesa (staging/19.3): drirc: Set vs_position_always_invariant for Shadow of Mordor on Intel

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 3 18:40:28 UTC 2019


Module: Mesa
Branch: staging/19.3
Commit: 553de940de8b8a6f253115c862fed8fff471f52a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=553de940de8b8a6f253115c862fed8fff471f52a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Nov 22 01:37:02 2019 -0800

drirc: Set vs_position_always_invariant for Shadow of Mordor on Intel

When drawing the main character in Shadow of Mordor, the game appears
to draw Talion with one vertex shader, and the Wraith with another.
If the compiler optimizes those in different ways which lead to slight
imprecisions, then the resulting positions may not line up, leading to
Z-fighting occurring as the game decides which of the two are in front.

brw_nir_opt_peephole_ffma looks at usages of multiply adds across the
entire shader, and may make different decisions between the two, leading
to such imprecisions and Z-fighting.  This started happening recently
after a NIR change to eliminate unnecessary MOVs (7025dbe7), but that
change simply exposed the existing problem.

Improves performance on Skylake GT4e by 1.22945% +/- 0.398672% (n=3),
likely due to the fixed rendering.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1985
Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.")
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 51cc380894b6c541ac3383336389242cf3f9fd67)

---

 src/util/00-mesa-defaults.conf | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf
index d64ffdbf211..c2d978e4866 100644
--- a/src/util/00-mesa-defaults.conf
+++ b/src/util/00-mesa-defaults.conf
@@ -550,4 +550,14 @@ TODO: document the other workarounds.
             <option name="gles_emulate_bgra" value="true" />
         </application>
     </device>
+    <device driver="i965">
+        <application name="Middle Earth: Shadow of Mordor" executable="ShadowOfMordor">
+            <option name="vs_position_always_invariant" value="true" />
+        </application>
+    </device>
+    <device driver="iris">
+        <application name="Middle Earth: Shadow of Mordor" executable="ShadowOfMordor">
+            <option name="vs_position_always_invariant" value="true" />
+        </application>
+    </device>
 </driconf>




More information about the mesa-commit mailing list