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:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user