Mesa (master): nir: fix clip cull lowering to not assert if GLSL already lowered.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 16 01:54:06 UTC 2018


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed May  9 13:21:43 2018 +1000

nir: fix clip cull lowering to not assert if GLSL already lowered.

If GLSL has already done the lowering, we'd rather not crash in this pass.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/compiler/nir/nir_lower_clip_cull_distance_arrays.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
index 86ce5fb1f8..2afbf9285c 100644
--- a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
+++ b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
@@ -144,6 +144,12 @@ combine_clip_cull(nir_shader *nir,
          cull = var;
    }
 
+   /* if the GLSL lowering pass has already run, don't bother repeating */
+   if (!cull && clip) {
+      if (!glsl_type_is_array(clip->type))
+         return false;
+   }
+
    const unsigned clip_array_size = get_unwrapped_array_length(nir, clip);
    const unsigned cull_array_size = get_unwrapped_array_length(nir, cull);
 




More information about the mesa-commit mailing list