summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2016-04-08 15:53:46 -0400
committerJason Ekstrand <[email protected]>2016-04-28 15:52:17 -0700
commit1c6307aab4eab16c70edd9bc237b82ba596b66e0 (patch)
tree0e4ab8322fd2c33ece9edc1dbe5cefa9ae9c7dcb
parent3bf3100794e4ec46c6cd4f2cd8773a70a6f5f091 (diff)
nir/lower_gs_intrinsics: fixup for new foreach_block()
v2 (Jason Ekstrand): Use nir_foreach_block_safe Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/compiler/nir/nir_lower_gs_intrinsics.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_lower_gs_intrinsics.c b/src/compiler/nir/nir_lower_gs_intrinsics.c
index a868e105bc3..406d7f0b5dc 100644
--- a/src/compiler/nir/nir_lower_gs_intrinsics.c
+++ b/src/compiler/nir/nir_lower_gs_intrinsics.c
@@ -131,10 +131,8 @@ rewrite_end_primitive(nir_intrinsic_instr *intrin, struct state *state)
}
static bool
-rewrite_intrinsics(nir_block *block, void *closure)
+rewrite_intrinsics(nir_block *block, struct state *state)
{
- struct state *state = closure;
-
nir_foreach_instr_safe(block, instr) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -206,7 +204,9 @@ nir_lower_gs_intrinsics(nir_shader *shader)
nir_builder_init(&b, function->impl);
state.builder = &b;
- nir_foreach_block_call(function->impl, rewrite_intrinsics, &state);
+ nir_foreach_block_safe(block, function->impl) {
+ rewrite_intrinsics(block, &state);
+ }
/* This only works because we have a single main() function. */
append_set_vertex_count(function->impl->end_block, &state);