aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-03-02 11:15:53 -0800
committerMatt Turner <[email protected]>2017-03-23 14:34:44 -0700
commit9dbf91f5c03fdfb77496fa67db48662a3829296a (patch)
treee0175a039fc7feb5cc2256cd8ddd2149d24156d5 /src/compiler
parent4e4927cd9552b6fa40ef526029215a3d57dd6df9 (diff)
nir: Return progress from nir_lower_clip_fs().
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.h2
-rw-r--r--src/compiler/nir/nir_lower_clip.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 8cd9d85996b..8c74af0dff7 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2498,7 +2498,7 @@ bool nir_lower_tex(nir_shader *shader,
bool nir_lower_idiv(nir_shader *shader);
bool nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables);
-void nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables);
+bool nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables);
bool nir_lower_clip_cull_distance_arrays(nir_shader *nir);
void nir_lower_two_sided_color(nir_shader *shader);
diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 227dcbb3f41..7bed46b1bfc 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -292,18 +292,20 @@ lower_clip_fs(nir_function_impl *impl, unsigned ucp_enables,
b.shader->info->fs.uses_discard = true;
}
}
+
+ nir_metadata_preserve(impl, nir_metadata_dominance);
}
/* insert conditional kill based on interpolated CLIPDIST
*/
-void
+bool
nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables)
{
nir_variable *in[2];
int maxloc = -1;
if (!ucp_enables)
- return;
+ return false;
nir_foreach_variable(var, &shader->inputs) {
int loc = var->data.driver_location;
@@ -332,4 +334,6 @@ nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables)
if (!strcmp(function->name, "main"))
lower_clip_fs(function->impl, ucp_enables, in);
}
+
+ return true;
}