nir/lower_gs_intrinsics: fixup for new foreach_block()
v2 (Jason Ekstrand): Use nir_foreach_block_safe Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:

committed by
Jason Ekstrand

parent
3bf3100794
commit
1c6307aab4
@@ -131,10 +131,8 @@ rewrite_end_primitive(nir_intrinsic_instr *intrin, struct state *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
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) {
|
nir_foreach_instr_safe(block, instr) {
|
||||||
if (instr->type != nir_instr_type_intrinsic)
|
if (instr->type != nir_instr_type_intrinsic)
|
||||||
continue;
|
continue;
|
||||||
@@ -206,7 +204,9 @@ nir_lower_gs_intrinsics(nir_shader *shader)
|
|||||||
nir_builder_init(&b, function->impl);
|
nir_builder_init(&b, function->impl);
|
||||||
state.builder = &b;
|
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. */
|
/* This only works because we have a single main() function. */
|
||||||
append_set_vertex_count(function->impl->end_block, &state);
|
append_set_vertex_count(function->impl->end_block, &state);
|
||||||
|
Reference in New Issue
Block a user