nir/lower_to_source_mods: fixup for new foreeach_block()

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Connor Abbott
2016-04-08 16:18:55 -04:00
committed by Jason Ekstrand
parent c81ca60b41
commit 2febb88e6d

View File

@@ -34,7 +34,7 @@
*/ */
static bool static bool
nir_lower_to_source_mods_block(nir_block *block, void *state) nir_lower_to_source_mods_block(nir_block *block)
{ {
nir_foreach_instr(block, instr) { nir_foreach_instr(block, instr) {
if (instr->type != nir_instr_type_alu) if (instr->type != nir_instr_type_alu)
@@ -181,17 +181,14 @@ nir_lower_to_source_mods_block(nir_block *block, void *state)
return true; return true;
} }
static void
nir_lower_to_source_mods_impl(nir_function_impl *impl)
{
nir_foreach_block_call(impl, nir_lower_to_source_mods_block, NULL);
}
void void
nir_lower_to_source_mods(nir_shader *shader) nir_lower_to_source_mods(nir_shader *shader)
{ {
nir_foreach_function(shader, function) { nir_foreach_function(shader, function) {
if (function->impl) if (function->impl) {
nir_lower_to_source_mods_impl(function->impl); nir_foreach_block(block, function->impl) {
nir_lower_to_source_mods_block(block);
}
}
} }
} }