Mesa (master): pan/midgard: Fix recursive csel scheduling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 18 14:55:28 UTC 2020


Module: Mesa
Branch: master
Commit: 4af8d5b0645bd96ed71691811e07c01b52af6094
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4af8d5b0645bd96ed71691811e07c01b52af6094

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Sat Jan 18 09:34:39 2020 -0500

pan/midgard: Fix recursive csel scheduling

Corner case causing invalid scheduling on shaders with nested csels,
i.e. GLSL code resembling:

   (foo ? bool1 : bool2) ? x : y

By explicitly disallowing csels this is fixed.

Fixes INSTR_INVALID_ENC on a glamor shader (noticeable with slowdown and
visual corruption when scrolling "too far" on GTK apps).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3463>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3463>

---

 src/panfrost/midgard/midgard_schedule.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index 2106d0d1ace..f369b09e2ab 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -669,6 +669,10 @@ mir_comparison_mobile(
                 if (instructions[i]->type != TAG_ALU_4)
                         return ~0;
 
+                /* If it would itself require a condition, that's recursive */
+                if (OP_IS_CSEL(instructions[i]->alu.op))
+                        return ~0;
+
                 /* We'll need to rewrite to .w but that doesn't work for vector
                  * ops that don't replicate (ball/bany), so bail there */
 



More information about the mesa-commit mailing list