- nir_foreach_function(function, s) {
- if (!function->impl)
- continue;
-
- nir_builder b;
- nir_builder_init(&b, function->impl);
-
- nir_foreach_block(block, function->impl) {
- nir_foreach_instr_safe(instr, block) {
- if (instr->type != nir_instr_type_tex)
- continue;
-
- vc4_nir_lower_txf_ms_instr(c, &b,
- nir_instr_as_tex(instr));
- }
- }
-
- nir_metadata_preserve(function->impl,
- nir_metadata_block_index |
- nir_metadata_dominance);
- }
+ nir_shader_lower_instructions(s,
+ v3d_nir_lower_txf_ms_filter,
+ v3d_nir_lower_txf_ms_instr,
+ NULL);