lavapipe: Use nir_builder_at

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23883>
This commit is contained in:
Konstantin Seurer 2023-06-27 13:02:34 +02:00 committed by Marge Bot
parent 47934ecf07
commit 8b606d5347

View file

@ -49,8 +49,7 @@ load_frag_coord(nir_builder *b)
}
static bool
try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load,
bool use_fragcoord_sysval)
try_lower_input_load(nir_intrinsic_instr *load, bool use_fragcoord_sysval)
{
nir_deref_instr *deref = nir_src_as_deref(load->src[0]);
assert(glsl_type_is_image(deref->type));
@ -60,8 +59,7 @@ try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load,
image_dim != GLSL_SAMPLER_DIM_SUBPASS_MS)
return false;
nir_builder b = nir_builder_create(impl);
b.cursor = nir_before_instr(&load->instr);
nir_builder b = nir_builder_at(nir_before_instr(&load->instr));
nir_ssa_def *frag_coord = use_fragcoord_sysval ? nir_load_frag_coord(&b)
: load_frag_coord(&b);
@ -98,8 +96,7 @@ lvp_lower_input_attachments(nir_shader *shader, bool use_fragcoord_sysval)
if (load->intrinsic != nir_intrinsic_image_deref_load)
continue;
progress |= try_lower_input_load(function->impl, load,
use_fragcoord_sysval);
progress |= try_lower_input_load(load, use_fragcoord_sysval);
}
}
}