aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-05-09 13:21:43 +1000
committerKenneth Graunke <[email protected]>2018-10-15 18:53:48 -0700
commitff281e62043203fd83f3f88e2ed68828646e155d (patch)
tree5b77b13ff0ffa80f8042aeadb39365cd6bbe814f /src
parent5bd836968172151d633675a5f9b4f8b646971a31 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_lower_clip_cull_distance_arrays.c6
1 files changed, 6 insertions, 0 deletions
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);