diff --git a/src/amd/common/ac_nir_lower_tex.c b/src/amd/common/ac_nir_lower_tex.c index 90ba0428dca..ca4930b116d 100644 --- a/src/amd/common/ac_nir_lower_tex.c +++ b/src/amd/common/ac_nir_lower_tex.c @@ -523,7 +523,7 @@ ac_nir_lower_tex(nir_shader *nir, const ac_nir_lower_tex_options *options) nir_function_impl *impl = nir_shader_get_entrypoint(nir); struct move_tex_coords_state state; - nir_builder_init(&state.toplevel_b, impl); + state.toplevel_b = nir_builder_create(impl); state.options = options; state.num_wqm_vgprs = 0; diff --git a/src/amd/vulkan/nir/radv_nir_apply_pipeline_layout.c b/src/amd/vulkan/nir/radv_nir_apply_pipeline_layout.c index 76fba733b49..a857c28cfa3 100644 --- a/src/amd/vulkan/nir/radv_nir_apply_pipeline_layout.c +++ b/src/amd/vulkan/nir/radv_nir_apply_pipeline_layout.c @@ -518,7 +518,7 @@ radv_nir_apply_pipeline_layout(nir_shader *shader, struct radv_device *device, if (!function->impl) continue; - nir_builder_init(&b, function->impl); + b = nir_builder_create(function->impl); /* Iterate in reverse so load_ubo lowering can look at * the vulkan_resource_index to tell if it's an inline diff --git a/src/amd/vulkan/nir/radv_nir_lower_fs_barycentric.c b/src/amd/vulkan/nir/radv_nir_lower_fs_barycentric.c index af98cc43a7f..c0355725b75 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_fs_barycentric.c +++ b/src/amd/vulkan/nir/radv_nir_lower_fs_barycentric.c @@ -274,7 +274,7 @@ radv_nir_lower_fs_barycentric(nir_shader *shader, const struct radv_pipeline_key if (!function->impl) continue; - nir_builder_init(&b, function->impl); + b = nir_builder_create(function->impl); nir_foreach_block (block, impl) { nir_foreach_instr_safe (instr, block) { diff --git a/src/amd/vulkan/radv_rt_shader.c b/src/amd/vulkan/radv_rt_shader.c index 1b67e95f499..022306ddd71 100644 --- a/src/amd/vulkan/radv_rt_shader.c +++ b/src/amd/vulkan/radv_rt_shader.c @@ -1534,7 +1534,7 @@ radv_nir_lower_rt_abi(nir_shader *shader, const VkRayTracingPipelineCreateInfoKH { nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); struct rt_variables vars = create_rt_variables(shader, pCreateInfo->flags); lower_rt_instructions(shader, &vars, 0); diff --git a/src/asahi/lib/agx_nir_lower_msaa.c b/src/asahi/lib/agx_nir_lower_msaa.c index 2c60915e826..c859831fa40 100644 --- a/src/asahi/lib/agx_nir_lower_msaa.c +++ b/src/asahi/lib/agx_nir_lower_msaa.c @@ -167,7 +167,7 @@ insert_sample_mask_write(nir_shader *s) { nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(s); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); b.cursor = nir_before_block(nir_start_block(impl)); /* Kill samples that are NOT covered by the mask */ diff --git a/src/compiler/glsl/gl_nir_lower_packed_varyings.c b/src/compiler/glsl/gl_nir_lower_packed_varyings.c index 939fcf58b04..0eeedd343a6 100644 --- a/src/compiler/glsl/gl_nir_lower_packed_varyings.c +++ b/src/compiler/glsl/gl_nir_lower_packed_varyings.c @@ -1010,7 +1010,7 @@ gl_nir_lower_packed_varyings(const struct gl_constants *consts, assert(f->impl == impl); } - nir_builder_init(&state.b, impl); + state.b = nir_builder_create(impl); state.consts = consts; state.prog = prog; state.mem_ctx = mem_ctx; diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 7eb7cdcb950..dda2b630b66 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -805,7 +805,7 @@ nir_visitor::visit(ir_function_signature *ir) this->is_global = false; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); b.cursor = nir_after_cf_list(&impl->body); unsigned i = (ir->return_type != glsl_type::void_type) ? 1 : 0; diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index 95f9a38e51f..186f58bffa8 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -833,7 +833,7 @@ bool nir_rematerialize_derefs_in_use_blocks_impl(nir_function_impl *impl) { struct rematerialize_deref_state state = { 0 }; - nir_builder_init(&state.builder, impl); + state.builder = nir_builder_create(impl); nir_foreach_block_unstructured(block, impl) { state.block = block; diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c index 0207d72a0f5..ee847304dde 100644 --- a/src/compiler/nir/nir_from_ssa.c +++ b/src/compiler/nir/nir_from_ssa.c @@ -856,7 +856,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only) struct from_ssa_state state; - nir_builder_init(&state.builder, impl); + state.builder = nir_builder_create(impl); state.dead_ctx = ralloc_context(NULL); state.phi_webs_only = phi_webs_only; state.merge_node_table = _mesa_pointer_hash_table_create(NULL); diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c index e189dc80d45..eb74c26a7b3 100644 --- a/src/compiler/nir/nir_lower_clip.c +++ b/src/compiler/nir/nir_lower_clip.c @@ -328,7 +328,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables, bool use_vars, if (!ucp_enables) return false; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); /* NIR should ensure that, even in case of loops/if-else, there * should be only a single predecessor block to end_block, which @@ -409,7 +409,7 @@ nir_lower_clip_gs(nir_shader *shader, unsigned ucp_enables, create_clipdist_vars(shader, out, ucp_enables, true, use_clipdist_array); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); nir_foreach_block(block, impl) lower_clip_in_gs_block(&b, block, position, clipvertex, out, diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index f25feff2dc3..33411bf40ee 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -718,7 +718,7 @@ nir_lower_io_impl(nir_function_impl *impl, struct lower_io_state state; bool progress = false; - nir_builder_init(&state.builder, impl); + state.builder = nir_builder_create(impl); state.dead_ctx = ralloc_context(NULL); state.modes = modes; state.type_size = type_size; diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c index 80e7a129693..91cb9402977 100644 --- a/src/compiler/nir/nir_lower_locals_to_regs.c +++ b/src/compiler/nir/nir_lower_locals_to_regs.c @@ -298,7 +298,7 @@ nir_lower_locals_to_regs_impl(nir_function_impl *impl, uint8_t bool_bitsize) { struct locals_to_regs_state state; - nir_builder_init(&state.builder, impl); + state.builder = nir_builder_create(impl); state.progress = false; state.regs_table = _mesa_hash_table_create(NULL, hash_deref, derefs_equal); state.bool_bitsize = bool_bitsize; diff --git a/src/compiler/nir/nir_lower_passthrough_edgeflags.c b/src/compiler/nir/nir_lower_passthrough_edgeflags.c index 0a7362288c9..2c47deb7509 100644 --- a/src/compiler/nir/nir_lower_passthrough_edgeflags.c +++ b/src/compiler/nir/nir_lower_passthrough_edgeflags.c @@ -32,7 +32,7 @@ lower_impl(nir_function_impl *impl) nir_variable *in, *out; nir_ssa_def *def; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); b.cursor = nir_before_cf_list(&impl->body); /* The edge flag is the last input in st/mesa. This code is also called by diff --git a/src/compiler/nir/nir_lower_pntc_ytransform.c b/src/compiler/nir/nir_lower_pntc_ytransform.c index 39cb1f3e420..91626f8d74d 100644 --- a/src/compiler/nir/nir_lower_pntc_ytransform.c +++ b/src/compiler/nir/nir_lower_pntc_ytransform.c @@ -116,7 +116,7 @@ nir_lower_pntc_ytransform(nir_shader *shader, nir_foreach_function(function, shader) { if (function->impl) { - nir_builder_init(&state.b, function->impl); + state.b = nir_builder_create(function->impl); nir_foreach_block(block, function->impl) { lower_pntc_ytransform_block(&state, block); diff --git a/src/compiler/nir/nir_lower_point_size_mov.c b/src/compiler/nir/nir_lower_point_size_mov.c index bcd9e635099..5edb29de2e3 100644 --- a/src/compiler/nir/nir_lower_point_size_mov.c +++ b/src/compiler/nir/nir_lower_point_size_mov.c @@ -40,7 +40,7 @@ lower_impl(nir_function_impl *impl, nir_builder b; nir_variable *in, *new_out = NULL; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); in = nir_state_variable_create(shader, glsl_vec4_type(), "gl_PointSizeClampedMESA", diff --git a/src/compiler/nir/nir_lower_returns.c b/src/compiler/nir/nir_lower_returns.c index d5d43ee611b..553cf03cda0 100644 --- a/src/compiler/nir/nir_lower_returns.c +++ b/src/compiler/nir/nir_lower_returns.c @@ -280,7 +280,7 @@ nir_lower_returns_impl(nir_function_impl *impl) state.return_flag = NULL; state.has_predicated_return = false; state.removed_unreachable_code = false; - nir_builder_init(&state.builder, impl); + state.builder = nir_builder_create(impl); bool progress = lower_returns_in_cf_list(&impl->body, &state); progress = progress || state.removed_unreachable_code; diff --git a/src/compiler/nir/nir_lower_shader_calls.c b/src/compiler/nir/nir_lower_shader_calls.c index 533a1e47ce6..762db4be44b 100644 --- a/src/compiler/nir/nir_lower_shader_calls.c +++ b/src/compiler/nir/nir_lower_shader_calls.c @@ -560,8 +560,8 @@ spill_ssa_defs_and_lower_shader_calls(nir_shader *shader, uint32_t num_calls, } nir_builder before, after; - nir_builder_init(&before, impl); - nir_builder_init(&after, impl); + before = nir_builder_create(impl); + after = nir_builder_create(impl); call_idx = 0; unsigned max_scratch_size = shader->scratch_size; diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c index e849f5420ad..9bc513cc9e8 100644 --- a/src/compiler/nir/nir_opt_combine_stores.c +++ b/src/compiler/nir/nir_opt_combine_stores.c @@ -400,7 +400,7 @@ static bool combine_stores_impl(struct combine_stores_state *state, nir_function_impl *impl) { state->progress = false; - nir_builder_init(&state->b, impl); + state->b = nir_builder_create(impl); nir_foreach_block(block, impl) combine_stores_block(state, block); diff --git a/src/compiler/nir/nir_opt_comparison_pre.c b/src/compiler/nir/nir_opt_comparison_pre.c index 33e6c51a597..8ae107012ed 100644 --- a/src/compiler/nir/nir_opt_comparison_pre.c +++ b/src/compiler/nir/nir_opt_comparison_pre.c @@ -379,7 +379,7 @@ nir_opt_comparison_pre_impl(nir_function_impl *impl) nir_builder bld; block_queue_init(&bq); - nir_builder_init(&bld, impl); + bld = nir_builder_create(impl); nir_metadata_require(impl, nir_metadata_dominance); diff --git a/src/compiler/nir/nir_opt_conditional_discard.c b/src/compiler/nir/nir_opt_conditional_discard.c index ba3d0b80ebc..1b24056351e 100644 --- a/src/compiler/nir/nir_opt_conditional_discard.c +++ b/src/compiler/nir/nir_opt_conditional_discard.c @@ -124,7 +124,7 @@ nir_opt_conditional_discard(nir_shader *shader) nir_foreach_function(function, shader) { if (function->impl) { - nir_builder_init(&builder, function->impl); + builder = nir_builder_create(function->impl); bool impl_progress = false; nir_foreach_block_safe(block, function->impl) { diff --git a/src/compiler/nir/nir_opt_find_array_copies.c b/src/compiler/nir/nir_opt_find_array_copies.c index 28626a2fb39..0d1eac91746 100644 --- a/src/compiler/nir/nir_opt_find_array_copies.c +++ b/src/compiler/nir/nir_opt_find_array_copies.c @@ -640,7 +640,7 @@ opt_find_array_copies_impl(nir_function_impl *impl) s.dead_ctx = ralloc_context(NULL); s.var_nodes = _mesa_pointer_hash_table_create(s.dead_ctx); s.cast_nodes = _mesa_pointer_hash_table_create(s.dead_ctx); - nir_builder_init(&s.builder, impl); + s.builder = nir_builder_create(impl); nir_foreach_block(block, impl) { if (opt_find_array_copies_block(&b, block, &s)) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 027bec4c351..1fd3e0d17f3 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -6629,7 +6629,7 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b, nir_function *main_entry_point = nir_function_create(b->shader, func_name); nir_function_impl *impl = nir_function_impl_create(main_entry_point); - nir_builder_init(&b->nb, impl); + b->nb = nir_builder_create(impl); b->nb.cursor = nir_after_cf_list(&impl->body); b->func_param_idx = 0; diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 4182a1a600f..4011186575e 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -225,7 +225,7 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, * directly in our OpFunctionParameter handler. */ nir_function_impl *impl = nir_function_impl_create(func); - nir_builder_init(&b->nb, impl); + b->nb = nir_builder_create(impl); b->nb.cursor = nir_before_cf_list(&impl->body); b->nb.exact = b->exact; @@ -627,7 +627,7 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func, } nir_function_impl *impl = func->nir_func->impl; - nir_builder_init(&b->nb, impl); + b->nb = nir_builder_create(impl); b->func = func; b->nb.cursor = nir_after_cf_list(&impl->body); b->nb.exact = b->exact; diff --git a/src/gallium/drivers/d3d12/d3d12_nir_passes.c b/src/gallium/drivers/d3d12/d3d12_nir_passes.c index b606dd8f627..8a3f236efa7 100644 --- a/src/gallium/drivers/d3d12/d3d12_nir_passes.c +++ b/src/gallium/drivers/d3d12/d3d12_nir_passes.c @@ -600,7 +600,7 @@ d3d12_add_missing_dual_src_target(struct nir_shader *s, assert(missing_mask != 0); nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(s); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); b.cursor = nir_before_cf_list(&impl->body); nir_ssa_def *zero = nir_imm_zero(&b, 4, 32); @@ -629,7 +629,7 @@ d3d12_lower_primitive_id(nir_shader *shader) nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(shader); nir_ssa_def *primitive_id; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); nir_variable *primitive_id_var = nir_variable_create(shader, nir_var_shader_out, glsl_uint_type(), "primitive_id"); @@ -745,7 +745,7 @@ d3d12_lower_triangle_strip(nir_shader *shader) nir_function_impl *impl = nir_shader_get_entrypoint(shader); nir_variable *tmp_vars[VARYING_SLOT_MAX] = {0}; nir_variable *out_vars[VARYING_SLOT_MAX] = {0}; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); shader->info.gs.vertices_out = (shader->info.gs.vertices_out - 2) * 3; diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 97470fac402..638f93a27d2 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -398,7 +398,7 @@ lower_gl_point_gs(nir_shader *shader) return false; nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); b.cursor = nir_before_cf_list(&entry->body); return nir_shader_instructions_pass(shader, lower_gl_point_gs_instr, @@ -640,7 +640,7 @@ lower_pv_mode_gs(nir_shader *shader, unsigned prim) memset(state.varyings, 0, sizeof(state.varyings)); nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); b.cursor = nir_before_cf_list(&entry->body); state.primitive_vert_count = @@ -793,7 +793,7 @@ lower_line_stipple_gs(nir_shader *shader, bool line_rectangular) state.line_rectangular = line_rectangular; // initialize pos_counter and stipple_counter nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); b.cursor = nir_before_cf_list(&entry->body); nir_store_var(&b, state.pos_counter, nir_imm_int(&b, 0), 1); nir_store_var(&b, state.stipple_counter, nir_imm_float(&b, 0), 1); @@ -807,7 +807,7 @@ lower_line_stipple_fs(nir_shader *shader) { nir_builder b; nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); // create stipple counter nir_variable *stipple = nir_variable_create(shader, nir_var_shader_in, @@ -1122,7 +1122,7 @@ lower_line_smooth_gs(nir_shader *shader) // initialize pos_counter nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); b.cursor = nir_before_cf_list(&entry->body); nir_store_var(&b, state.pos_counter, nir_imm_int(&b, 0), 1); @@ -1156,7 +1156,7 @@ lower_line_smooth_fs(nir_shader *shader, bool lower_stipple) // initialize stipple_pattern nir_function_impl *entry = nir_shader_get_entrypoint(shader); - nir_builder_init(&b, entry); + b = nir_builder_create(entry); b.cursor = nir_before_cf_list(&entry->body); nir_ssa_def *pattern = nir_load_push_constant(&b, 1, 32, nir_imm_int(&b, ZINK_GFX_PUSHCONST_LINE_STIPPLE_PATTERN), @@ -2540,7 +2540,7 @@ clamp_layer_output(nir_shader *vs, nir_shader *fs, unsigned *next_location) } else { nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(vs); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); assert(impl->end_block->predecessors->entries == 1); b.cursor = nir_after_cf_list(&impl->body); clamp_layer_output_emit(&b, &state); diff --git a/src/imagination/rogue/nir/rogue_nir_pfo.c b/src/imagination/rogue/nir/rogue_nir_pfo.c index c376c45fbc0..8ffc0bf89e0 100644 --- a/src/imagination/rogue/nir/rogue_nir_pfo.c +++ b/src/imagination/rogue/nir/rogue_nir_pfo.c @@ -61,7 +61,7 @@ void rogue_nir_pfo(nir_shader *shader) if (shader->info.stage != MESA_SHADER_FRAGMENT) return; - nir_builder_init(&b, impl); + b = nir_builder_create(impl); nir_foreach_block (block, impl) { nir_foreach_instr_safe (instr, block) { diff --git a/src/intel/compiler/brw_mesh.cpp b/src/intel/compiler/brw_mesh.cpp index d558bc9efc2..50e0a193b04 100644 --- a/src/intel/compiler/brw_mesh.cpp +++ b/src/intel/compiler/brw_mesh.cpp @@ -639,7 +639,7 @@ brw_nir_initialize_mue(nir_shader *nir, nir_builder b; nir_function_impl *entrypoint = nir_shader_get_entrypoint(nir); - nir_builder_init(&b, entrypoint); + b = nir_builder_create(entrypoint); b.cursor = nir_before_block(nir_start_block(entrypoint)); nir_ssa_def *dw_off = nir_imm_int(&b, 0); diff --git a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c index be2f772fbad..f5a7b58c5a4 100644 --- a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c +++ b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c @@ -277,7 +277,7 @@ lower_cs_intrinsics_convert_block(struct lower_intrinsics_state *state, static void lower_cs_intrinsics_convert_impl(struct lower_intrinsics_state *state) { - nir_builder_init(&state->builder, state->impl); + state->builder = nir_builder_create(state->impl); nir_foreach_block(block, state->impl) { lower_cs_intrinsics_convert_block(state, block); diff --git a/src/intel/compiler/brw_nir_lower_ray_queries.c b/src/intel/compiler/brw_nir_lower_ray_queries.c index 50a287ff6ea..c1a9217f620 100644 --- a/src/intel/compiler/brw_nir_lower_ray_queries.c +++ b/src/intel/compiler/brw_nir_lower_ray_queries.c @@ -503,7 +503,7 @@ static void lower_ray_query_impl(nir_function_impl *impl, struct lowering_state *state) { nir_builder _b, *b = &_b; - nir_builder_init(&_b, impl); + _b = nir_builder_create(impl); b->cursor = nir_before_block(nir_start_block(b->impl)); diff --git a/src/intel/compiler/brw_nir_rt.c b/src/intel/compiler/brw_nir_rt.c index f1c70bdfcb8..97402bd591d 100644 --- a/src/intel/compiler/brw_nir_rt.c +++ b/src/intel/compiler/brw_nir_rt.c @@ -505,7 +505,7 @@ brw_nir_create_raygen_trampoline(const struct brw_compiler *compiler, NIR_PASS_V(nir, brw_nir_lower_rt_intrinsics, devinfo); - nir_builder_init(&b, nir_shader_get_entrypoint(b.shader)); + b = nir_builder_create(nir_shader_get_entrypoint(b.shader)); /* brw_nir_lower_rt_intrinsics will leave us with a btd_global_arg_addr * intrinsic which doesn't exist in compute shaders. We also created one * above when we generated the BTD spawn intrinsic. Now we go through and diff --git a/src/intel/vulkan/anv_nir_lower_multiview.c b/src/intel/vulkan/anv_nir_lower_multiview.c index 46a3a2cfe05..4b4ebb598ce 100644 --- a/src/intel/vulkan/anv_nir_lower_multiview.c +++ b/src/intel/vulkan/anv_nir_lower_multiview.c @@ -224,7 +224,7 @@ anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask, .view_mask = view_mask, }; - nir_builder_init(&state.builder, entrypoint); + state.builder = nir_builder_create(entrypoint); nir_foreach_block(block, entrypoint) { nir_foreach_instr_safe(instr, block) { diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 03360bbe02c..786e056eb30 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -122,7 +122,7 @@ anv_nir_lower_set_vtx_and_prim_count(nir_shader *nir) if (state.primitive_count == NULL) { nir_builder b; nir_function_impl *entrypoint = nir_shader_get_entrypoint(nir); - nir_builder_init(&b, entrypoint); + b = nir_builder_create(entrypoint); b.cursor = nir_before_block(nir_start_block(entrypoint)); nir_ssa_def *zero = nir_imm_int(&b, 0); state.primitive_count = anv_nir_prim_count_store(&b, zero); diff --git a/src/intel/vulkan_hasvk/anv_nir_lower_multiview.c b/src/intel/vulkan_hasvk/anv_nir_lower_multiview.c index 3375714b31d..576439dc728 100644 --- a/src/intel/vulkan_hasvk/anv_nir_lower_multiview.c +++ b/src/intel/vulkan_hasvk/anv_nir_lower_multiview.c @@ -198,7 +198,7 @@ anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask) .view_mask = view_mask, }; - nir_builder_init(&state.builder, entrypoint); + state.builder = nir_builder_create(entrypoint); nir_foreach_block(block, entrypoint) { nir_foreach_instr_safe(instr, block) { diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index bec2d850142..c1f46072cc9 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -241,7 +241,7 @@ st_nir_add_point_size(nir_shader *nir) nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); bool found = false; nir_foreach_block_safe(block, impl) { nir_foreach_instr_safe(instr, block) { @@ -315,7 +315,7 @@ st_nir_zero_initialize_clip_distance(nir_shader *nir) return false; nir_builder b; nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_builder_init(&b, impl); + b = nir_builder_create(impl); b.cursor = nir_before_block(nir_start_block(impl)); if (clip_dist0) zero_array_members(&b, clip_dist0);