Mesa (android-radeonsi-build-fix): nir/lower_clip: Fix incorrect driver loc for clipdist outputs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 4 22:02:17 UTC 2019


Module: Mesa
Branch: android-radeonsi-build-fix
Commit: 372ed42d222a274abe712b62f4b037cbeb6fddb5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=372ed42d222a274abe712b62f4b037cbeb6fddb5

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Dec  3 16:28:26 2019 -0800

nir/lower_clip: Fix incorrect driver loc for clipdist outputs

Somehow adjusting maxloc based on existing outputs got lost, resulting
in the clipdist varying clobbering the position varying.  Causing a
shader that had no position output in freedreno/ir3, which triggers GPU
hangs in neverball.

Fixes: d0f746b6458 ("nir: Save nir_variable pointers in nir_lower_clip_vs rather than locs.")
Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>

---

 src/compiler/nir/nir_lower_clip.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index cf8a5d93c76..0f0d2eb2c73 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -317,6 +317,17 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars,
    if (!ucp_enables)
       return false;
 
+   /* find clipvertex/position outputs: */
+   nir_foreach_variable(var, &shader->outputs) {
+      int loc = var->data.driver_location;
+
+      /* keep track of last used driver-location.. we'll be
+       * appending CLIP_DIST0/CLIP_DIST1 after last existing
+       * output:
+       */
+      maxloc = MAX2(maxloc, loc);
+   }
+
    nir_builder_init(&b, impl);
 
    /* NIR should ensure that, even in case of loops/if-else, there




More information about the mesa-commit mailing list