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

committed by
Jason Ekstrand

parent
c1b37c08bf
commit
492b3554a7
@@ -154,9 +154,12 @@ nir_lower_var_copy_instr(nir_intrinsic_instr *copy, void *mem_ctx)
|
|||||||
©->variables[1]->deref, mem_ctx);
|
©->variables[1]->deref, mem_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static void
|
||||||
lower_var_copies_block(nir_block *block, void *mem_ctx)
|
lower_var_copies_impl(nir_function_impl *impl)
|
||||||
{
|
{
|
||||||
|
void *mem_ctx = ralloc_parent(impl);
|
||||||
|
|
||||||
|
nir_foreach_block(block, impl) {
|
||||||
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;
|
||||||
@@ -170,14 +173,7 @@ lower_var_copies_block(nir_block *block, void *mem_ctx)
|
|||||||
nir_instr_remove(©->instr);
|
nir_instr_remove(©->instr);
|
||||||
ralloc_free(copy);
|
ralloc_free(copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
lower_var_copies_impl(nir_function_impl *impl)
|
|
||||||
{
|
|
||||||
nir_foreach_block_call(impl, lower_var_copies_block, ralloc_parent(impl));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lowers every copy_var instruction in the program to a sequence of
|
/* Lowers every copy_var instruction in the program to a sequence of
|
||||||
|
Reference in New Issue
Block a user