From: Dave Airlie <airl...@redhat.com>

If GLSL has already done the lowering, we'd rather not crash in this pass.
Reviewed-by: Kenneth Graunke <kenn...@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 86ce5fb1f86..2afbf9285c0 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);
 
-- 
2.19.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to