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@whitecape.org>
This commit is contained in:
Dave Airlie 2018-05-09 13:21:43 +10:00 committed by Kenneth Graunke
parent 5bd8369681
commit ff281e6204
1 changed files with 6 additions and 0 deletions

View File

@ -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);