intel: Use nir_builder_at
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
This commit is contained in:

committed by
Marge Bot

parent
ed08305549
commit
05269047d3
@@ -468,9 +468,8 @@ iris_setup_uniforms(ASSERTED const struct intel_device_info *devinfo,
|
||||
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
nir_builder b = nir_builder_at(nir_before_block(nir_start_block(impl)));
|
||||
|
||||
b.cursor = nir_before_block(nir_start_block(impl));
|
||||
nir_ssa_def *temp_ubo_name = nir_ssa_undef(&b, 1, 32);
|
||||
|
||||
/* Turn system value intrinsics into uniforms */
|
||||
|
@@ -639,8 +639,7 @@ brw_nir_initialize_mue(nir_shader *nir,
|
||||
|
||||
nir_builder b;
|
||||
nir_function_impl *entrypoint = nir_shader_get_entrypoint(nir);
|
||||
b = nir_builder_create(entrypoint);
|
||||
b.cursor = nir_before_block(nir_start_block(entrypoint));
|
||||
b = nir_builder_at(nir_before_block(nir_start_block(entrypoint)));
|
||||
|
||||
nir_ssa_def *dw_off = nir_imm_int(&b, 0);
|
||||
nir_ssa_def *zerovec = nir_imm_vec4(&b, 0, 0, 0, 0);
|
||||
|
@@ -167,11 +167,9 @@ brw_nir_lower_alpha_to_coverage(nir_shader *shader,
|
||||
&sample_mask_write->instr);
|
||||
}
|
||||
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
nir_builder b = nir_builder_at(nir_before_instr(&sample_mask_write->instr));
|
||||
|
||||
/* Combine dither_mask and the gl_SampleMask value */
|
||||
b.cursor = nir_before_instr(&sample_mask_write->instr);
|
||||
|
||||
nir_ssa_def *dither_mask = build_dither_mask(&b, color0);
|
||||
dither_mask = nir_iand(&b, sample_mask, dither_mask);
|
||||
|
||||
|
@@ -55,11 +55,9 @@ lower_any_hit_for_intersection(nir_shader *any_hit)
|
||||
ralloc_array(any_hit, nir_parameter, ARRAY_SIZE(params));
|
||||
memcpy(impl->function->params, params, sizeof(params));
|
||||
|
||||
nir_builder build = nir_builder_create(impl);
|
||||
nir_builder build = nir_builder_at(nir_before_cf_list(&impl->body));
|
||||
nir_builder *b = &build;
|
||||
|
||||
b->cursor = nir_before_cf_list(&impl->body);
|
||||
|
||||
nir_ssa_def *commit_ptr = nir_load_param(b, 0);
|
||||
nir_ssa_def *hit_t = nir_load_param(b, 1);
|
||||
nir_ssa_def *hit_kind = nir_load_param(b, 2);
|
||||
@@ -156,11 +154,9 @@ brw_nir_lower_intersection_shader(nir_shader *intersection,
|
||||
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(intersection);
|
||||
|
||||
nir_builder build = nir_builder_create(impl);
|
||||
nir_builder build = nir_builder_at(nir_before_cf_list(&impl->body));
|
||||
nir_builder *b = &build;
|
||||
|
||||
b->cursor = nir_before_cf_list(&impl->body);
|
||||
|
||||
nir_ssa_def *t_addr = brw_nir_rt_mem_hit_addr(b, false /* committed */);
|
||||
nir_variable *commit =
|
||||
nir_local_variable_create(impl, glsl_bool_type(), "ray_commit");
|
||||
|
@@ -503,9 +503,7 @@ static void
|
||||
lower_ray_query_impl(nir_function_impl *impl, struct lowering_state *state)
|
||||
{
|
||||
nir_builder _b, *b = &_b;
|
||||
_b = nir_builder_create(impl);
|
||||
|
||||
b->cursor = nir_before_block(nir_start_block(b->impl));
|
||||
_b = nir_builder_at(nir_before_block(nir_start_block(impl)));
|
||||
|
||||
state->rq_globals = nir_load_ray_query_global_intel(b);
|
||||
|
||||
|
@@ -50,11 +50,9 @@ lower_rt_intrinsics_impl(nir_function_impl *impl,
|
||||
{
|
||||
bool progress = false;
|
||||
|
||||
nir_builder build = nir_builder_create(impl);
|
||||
nir_builder build = nir_builder_at(nir_before_block(nir_start_block(impl)));
|
||||
nir_builder *b = &build;
|
||||
|
||||
b->cursor = nir_before_block(nir_start_block(b->impl));
|
||||
|
||||
struct brw_nir_rt_globals_defs globals;
|
||||
brw_nir_rt_load_globals(b, &globals);
|
||||
|
||||
|
@@ -78,9 +78,8 @@ lower_rt_io_derefs(nir_shader *shader)
|
||||
*/
|
||||
assert(num_shader_call_vars <= 1);
|
||||
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
nir_builder b = nir_builder_at(nir_before_cf_list(&impl->body));
|
||||
|
||||
b.cursor = nir_before_cf_list(&impl->body);
|
||||
nir_ssa_def *call_data_addr = NULL;
|
||||
if (num_shader_call_vars > 0) {
|
||||
assert(shader->scratch_size >= BRW_BTD_STACK_CALLEE_DATA_SIZE);
|
||||
|
@@ -153,8 +153,7 @@ anv_mesh_convert_attrs_prim_to_vert(struct nir_shader *nir,
|
||||
num_mesh_vertices_per_primitive(nir->info.mesh.primitive_type);
|
||||
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
b.cursor = nir_after_cf_list(&impl->body);
|
||||
nir_builder b = nir_builder_at(nir_after_cf_list(&impl->body));
|
||||
|
||||
/* wait for all subgroups to finish */
|
||||
nir_scoped_barrier(&b, SCOPE_WORKGROUP);
|
||||
@@ -494,8 +493,7 @@ anv_frag_convert_attrs_prim_to_vert(struct nir_shader *nir,
|
||||
nir_deref_instr *new_derefs[VARYING_SLOT_MAX] = {NULL, };
|
||||
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
b.cursor = nir_before_cf_list(&impl->body);
|
||||
nir_builder b = nir_builder_at(nir_before_cf_list(&impl->body));
|
||||
|
||||
nir_foreach_shader_in_variable_safe(var, nir) {
|
||||
gl_varying_slot location = var->data.location;
|
||||
|
@@ -204,8 +204,7 @@ anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask,
|
||||
bool progress = nir_lower_multiview(shader, view_mask);
|
||||
|
||||
if (progress) {
|
||||
nir_builder b = nir_builder_create(entrypoint);
|
||||
b.cursor = nir_before_cf_list(&entrypoint->body);
|
||||
nir_builder b = nir_builder_at(nir_before_cf_list(&entrypoint->body));
|
||||
|
||||
/* Fill Layer ID with zero. Replication will use that as base to
|
||||
* apply the RTAI offsets.
|
||||
|
@@ -122,8 +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);
|
||||
b = nir_builder_create(entrypoint);
|
||||
b.cursor = nir_before_block(nir_start_block(entrypoint));
|
||||
b = nir_builder_at(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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user