gitlab-ci: Add ppc64el and s390x cross-build jobs
[mesa.git] / src / compiler / nir / nir_lower_clip.c
index cf8a5d93c76450998e17fee26efc88298ff93d3e..0f0d2eb2c73d3e182609285274d487916a0d533a 100644 (file)
@@ -317,6 +317,17 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars,
    if (!ucp_enables)
       return false;
 
+   /* find clipvertex/position outputs: */
+   nir_foreach_variable(var, &shader->outputs) {
+      int loc = var->data.driver_location;
+
+      /* keep track of last used driver-location.. we'll be
+       * appending CLIP_DIST0/CLIP_DIST1 after last existing
+       * output:
+       */
+      maxloc = MAX2(maxloc, loc);
+   }
+
    nir_builder_init(&b, impl);
 
    /* NIR should ensure that, even in case of loops/if-else, there