diff options
author | Jason Ekstrand <[email protected]> | 2016-04-28 10:34:52 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-05 16:19:41 -0700 |
commit | 31fc4a2528055f63646cac494bd30f0eb07c8210 (patch) | |
tree | 1b694a83b3814690475cea1e2978c81b0c4fef17 /src | |
parent | 450c0613627d5a472fcf1122c15b66988abfb372 (diff) |
nir/lower_double_ops: fixup for new nir_foreach_block()
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Connor Abbott <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir_lower_double_ops.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c index ae3a596216e..fdd0f447448 100644 --- a/src/compiler/nir/nir_lower_double_ops.c +++ b/src/compiler/nir/nir_lower_double_ops.c @@ -562,32 +562,18 @@ lower_doubles_instr(nir_alu_instr *instr, nir_lower_doubles_options options) nir_instr_remove(&instr->instr); } -static bool -lower_doubles_block(nir_block *block, void *ctx) -{ - nir_lower_doubles_options options = *((nir_lower_doubles_options *) ctx); - - nir_foreach_instr_safe(instr, block) { - if (instr->type != nir_instr_type_alu) - continue; - - lower_doubles_instr(nir_instr_as_alu(instr), options); - } - - return true; -} - -static void -lower_doubles_impl(nir_function_impl *impl, nir_lower_doubles_options options) -{ - nir_foreach_block_call(impl, lower_doubles_block, &options); -} - void nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options) { nir_foreach_function(function, shader) { - if (function->impl) - lower_doubles_impl(function->impl, options); + if (!function->impl) + continue; + + nir_foreach_block(block, function->impl) { + nir_foreach_instr_safe(instr, block) { + if (instr->type == nir_instr_type_alu) + lower_doubles_instr(nir_instr_as_alu(instr), options); + } + } } } |