diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 49345dc8d1c..7f8ca8e3dfe 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -517,9 +517,9 @@ add_var_use_shader(nir_shader *shader, struct hash_table *live) /* Size of the derefs buffer in bytes. */ unsigned derefs_size = 0; - nir_foreach_function(function, shader) { - if (function->impl) { - nir_foreach_block(block, function->impl) { + nir_foreach_function_impl(impl, shader) { + { + nir_foreach_block(block, impl) { nir_foreach_instr(instr, block) { if (instr->type == nir_instr_type_intrinsic) { nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); diff --git a/src/compiler/glsl/gl_nir_link_varyings.c b/src/compiler/glsl/gl_nir_link_varyings.c index fe9eece4433..5d5c923cc51 100644 --- a/src/compiler/glsl/gl_nir_link_varyings.c +++ b/src/compiler/glsl/gl_nir_link_varyings.c @@ -2039,11 +2039,8 @@ get_num_components(nir_variable *var) static void tcs_add_output_reads(nir_shader *shader, BITSET_WORD **read) { - nir_foreach_function(function, shader) { - if (!function->impl) - continue; - - nir_foreach_block(block, function->impl) { + nir_foreach_function_impl(impl, shader) { + nir_foreach_block(block, impl) { nir_foreach_instr(instr, block) { if (instr->type != nir_instr_type_intrinsic) continue; diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index ea933cd1d9c..bd54a740420 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -874,8 +874,8 @@ validate_sampler_array_indexing(const struct gl_constants *consts, consts->ShaderCompilerOptions[i].NirOptions->force_indirect_unrolling_sampler; bool uses_indirect_sampler_array_indexing = false; - nir_foreach_function(function, prog->_LinkedShaders[i]->Program->nir) { - nir_foreach_block(block, function->impl) { + nir_foreach_function_impl(impl, prog->_LinkedShaders[i]->Program->nir) { + nir_foreach_block(block, impl) { nir_foreach_instr(instr, block) { /* Check if a sampler array is accessed indirectly */ if (instr->type == nir_instr_type_tex) { diff --git a/src/compiler/glsl/gl_nir_lower_buffers.c b/src/compiler/glsl/gl_nir_lower_buffers.c index b90ab46c318..2855e2f2c15 100644 --- a/src/compiler/glsl/gl_nir_lower_buffers.c +++ b/src/compiler/glsl/gl_nir_lower_buffers.c @@ -341,9 +341,8 @@ gl_nir_lower_buffers(nir_shader *shader, * a nir_address_format_32bit_index_offset pointer. From there forward, * we leave the derefs in place and let nir_lower_explicit_io handle them. */ - nir_foreach_function(function, shader) { - if (function->impl && - lower_buffer_interface_derefs_impl(function->impl, shader_program)) + nir_foreach_function_impl(impl, shader) { + if (lower_buffer_interface_derefs_impl(impl, shader_program)) progress = true; } diff --git a/src/compiler/glsl/tests/test_gl_lower_mediump.cpp b/src/compiler/glsl/tests/test_gl_lower_mediump.cpp index 5316ac00d38..91aff5788d0 100644 --- a/src/compiler/glsl/tests/test_gl_lower_mediump.cpp +++ b/src/compiler/glsl/tests/test_gl_lower_mediump.cpp @@ -60,9 +60,9 @@ namespace if (!nir) return NULL; - nir_foreach_function(func, nir) + nir_foreach_function_impl(impl, nir) { - nir_foreach_block(block, func->impl) + nir_foreach_block(block, impl) { nir_foreach_instr(instr, block) {