nir: Bail on clip/cull distance lowering if GLSL IR already did it.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Jan 2019 10:36:44 +0000 (02:36 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 5 Feb 2019 21:58:46 +0000 (13:58 -0800)
We have a GLSL IR pass to convert clip/cull distance float[] arrays
into vec4[2] arrays.  In ff281e6204, we attempted to skip this pass
if the GLSL IR lowering had already run.  But, that code was not quite
right, as we forgot to strip away the per-vertex IO array layer for
geometry and tessellation shader varyings.

If the GLSL IR pass has run, the variables will not be marked as
"compact".  So we can simply check that and bail.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_lower_clip_cull_distance_arrays.c

index 6e1557ef40d5e324c813b845303ccc6d0cfaa854..79d61fabea3519925739d6e35b966fae0ac03c9d 100644 (file)
@@ -144,9 +144,9 @@ 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))
+      /* The GLSL IR lowering pass must have converted these to vectors */
+      if (!clip->data.compact)
          return false;
    }