nir: Use nir_shader_get_entrypoint in nir_lower_clip_vs().
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 22 May 2017 02:26:03 +0000 (19:26 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Nov 2018 22:31:20 +0000 (14:31 -0800)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/nir/nir_lower_clip.c

index 9e2d9a5cf5050a526527cb4f72b312030ab4805b..7d9dc04cb1700c65827af89089b3bf743fa98b51 100644 (file)
@@ -198,6 +198,7 @@ lower_clip_vs(nir_function_impl *impl, unsigned ucp_enables,
 bool
 nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables)
 {
+   nir_function_impl *impl = nir_shader_get_entrypoint(shader);
    int clipvertex = -1;
    int position = -1;
    int maxloc = -1;
@@ -249,10 +250,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables)
       out[1] =
          create_clipdist_var(shader, ++maxloc, true, VARYING_SLOT_CLIP_DIST1);
 
-   nir_foreach_function(function, shader) {
-      if (!strcmp(function->name, "main"))
-         lower_clip_vs(function->impl, ucp_enables, cv, out);
-   }
+   lower_clip_vs(impl, ucp_enables, cv, out);
 
    return true;
 }