glsl: Switch to use nir_foreach_function_impl from nir_foreach_function

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23920>
This commit is contained in:
Yonggang Luo 2023-06-28 19:00:27 +08:00 committed by Marge Bot
parent 4a8ec0db90
commit dcf9cfd297
5 changed files with 11 additions and 15 deletions

View file

@ -517,9 +517,9 @@ add_var_use_shader(nir_shader *shader, struct hash_table *live)
/* Size of the derefs buffer in bytes. */ /* Size of the derefs buffer in bytes. */
unsigned derefs_size = 0; unsigned derefs_size = 0;
nir_foreach_function(function, shader) { nir_foreach_function_impl(impl, shader) {
if (function->impl) { {
nir_foreach_block(block, function->impl) { nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) { nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_intrinsic) { if (instr->type == nir_instr_type_intrinsic) {
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);

View file

@ -2039,11 +2039,8 @@ get_num_components(nir_variable *var)
static void static void
tcs_add_output_reads(nir_shader *shader, BITSET_WORD **read) tcs_add_output_reads(nir_shader *shader, BITSET_WORD **read)
{ {
nir_foreach_function(function, shader) { nir_foreach_function_impl(impl, shader) {
if (!function->impl) nir_foreach_block(block, impl) {
continue;
nir_foreach_block(block, function->impl) {
nir_foreach_instr(instr, block) { nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic) if (instr->type != nir_instr_type_intrinsic)
continue; continue;

View file

@ -874,8 +874,8 @@ validate_sampler_array_indexing(const struct gl_constants *consts,
consts->ShaderCompilerOptions[i].NirOptions->force_indirect_unrolling_sampler; consts->ShaderCompilerOptions[i].NirOptions->force_indirect_unrolling_sampler;
bool uses_indirect_sampler_array_indexing = false; bool uses_indirect_sampler_array_indexing = false;
nir_foreach_function(function, prog->_LinkedShaders[i]->Program->nir) { nir_foreach_function_impl(impl, prog->_LinkedShaders[i]->Program->nir) {
nir_foreach_block(block, function->impl) { nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) { nir_foreach_instr(instr, block) {
/* Check if a sampler array is accessed indirectly */ /* Check if a sampler array is accessed indirectly */
if (instr->type == nir_instr_type_tex) { if (instr->type == nir_instr_type_tex) {

View file

@ -341,9 +341,8 @@ gl_nir_lower_buffers(nir_shader *shader,
* a nir_address_format_32bit_index_offset pointer. From there forward, * 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. * we leave the derefs in place and let nir_lower_explicit_io handle them.
*/ */
nir_foreach_function(function, shader) { nir_foreach_function_impl(impl, shader) {
if (function->impl && if (lower_buffer_interface_derefs_impl(impl, shader_program))
lower_buffer_interface_derefs_impl(function->impl, shader_program))
progress = true; progress = true;
} }

View file

@ -60,9 +60,9 @@ namespace
if (!nir) if (!nir)
return NULL; 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) nir_foreach_instr(instr, block)
{ {