mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-21 00:18:09 +02:00
intel/vulkan: Convert to use nir_foreach_function_impl when possible
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24040>
This commit is contained in:
parent
b6cfb9aa9d
commit
7471bc2574
6 changed files with 22 additions and 52 deletions
|
|
@ -228,11 +228,8 @@ anv_mesh_convert_attrs_prim_to_vert(struct nir_shader *nir,
|
|||
|
||||
/* Update types of derefs to match type of variables they (de)reference. */
|
||||
if (dup_vertices) {
|
||||
nir_foreach_function(function, b.shader) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_function_impl(impl, b.shader) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr(instr, block) {
|
||||
if (instr->type != nir_instr_type_deref)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -1821,11 +1821,8 @@ static void
|
|||
anv_validate_pipeline_layout(const struct anv_pipeline_sets_layout *layout,
|
||||
nir_shader *shader)
|
||||
{
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -44,11 +44,8 @@ anv_nir_compute_push_layout(nir_shader *nir,
|
|||
|
||||
bool has_const_ubo = false;
|
||||
unsigned push_start = UINT_MAX, push_end = 0;
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
@ -146,14 +143,11 @@ anv_nir_compute_push_layout(nir_shader *nir,
|
|||
};
|
||||
|
||||
if (has_push_intrinsic) {
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_builder build, *b = &build;
|
||||
nir_builder_init(b, function->impl);
|
||||
nir_builder_init(b, impl);
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -75,11 +75,8 @@ anv_nir_compute_used_push_descriptors(nir_shader *shader,
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -119,11 +116,8 @@ anv_nir_loads_push_desc_buffer(nir_shader *nir,
|
|||
if (push_set_layout == NULL)
|
||||
return false;
|
||||
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
@ -180,11 +174,8 @@ anv_nir_push_desc_ubo_fully_promoted(nir_shader *nir,
|
|||
ubos_fully_promoted |= BITFIELD_BIT(bind_layout->descriptor_index);
|
||||
}
|
||||
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -877,11 +877,8 @@ anv_nir_compute_dynamic_push_bits(nir_shader *shader)
|
|||
{
|
||||
enum anv_dynamic_push_bits ret = 0;
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -41,11 +41,8 @@ anv_nir_compute_push_layout(nir_shader *nir,
|
|||
|
||||
bool has_const_ubo = false;
|
||||
unsigned push_start = UINT_MAX, push_end = 0;
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
@ -127,14 +124,11 @@ anv_nir_compute_push_layout(nir_shader *nir,
|
|||
};
|
||||
|
||||
if (has_push_intrinsic) {
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
nir_foreach_function_impl(impl, nir) {
|
||||
nir_builder build, *b = &build;
|
||||
nir_builder_init(b, function->impl);
|
||||
nir_builder_init(b, impl);
|
||||
|
||||
nir_foreach_block(block, function->impl) {
|
||||
nir_foreach_block(block, impl) {
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue