From: Alyssa Rosenzweig Date: Sun, 13 Aug 2023 13:27:28 +0000 (-0400) Subject: lvp,nir/lower_input_attachments: Use nir_trim_vector X-Git-Tag: upstream/23.3.3~3281 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c182ab2b8349402d2736ce97119c85dd89668ee8;p=platform%2Fupstream%2Fmesa.git lvp,nir/lower_input_attachments: Use nir_trim_vector Make the trimming obvious. We will lock down ssa_for_src soon. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Emma Anholt Part-of: --- diff --git a/src/compiler/nir/nir_lower_input_attachments.c b/src/compiler/nir/nir_lower_input_attachments.c index 10094ce..e1b7065 100644 --- a/src/compiler/nir/nir_lower_input_attachments.c +++ b/src/compiler/nir/nir_lower_input_attachments.c @@ -99,7 +99,7 @@ try_lower_input_load(nir_builder *b, nir_intrinsic_instr *load, nir_def *frag_coord = load_frag_coord(b, deref, options); frag_coord = nir_f2i32(b, frag_coord); - nir_def *offset = nir_ssa_for_src(b, load->src[1], 2); + nir_def *offset = nir_trim_vector(b, load->src[1].ssa, 2); nir_def *pos = nir_iadd(b, frag_coord, offset); nir_def *layer = load_layer_id(b, options); diff --git a/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c b/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c index b46f7ed..2ea97f4 100644 --- a/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c +++ b/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c @@ -64,7 +64,7 @@ try_lower_input_load(nir_intrinsic_instr *load, bool use_fragcoord_sysval) nir_def *frag_coord = use_fragcoord_sysval ? nir_load_frag_coord(&b) : load_frag_coord(&b); frag_coord = nir_f2i32(&b, frag_coord); - nir_def *offset = nir_ssa_for_src(&b, load->src[1], 2); + nir_def *offset = nir_trim_vector(&b, load->src[1].ssa, 2); nir_def *pos = nir_iadd(&b, frag_coord, offset); nir_def *layer = nir_load_view_index(&b);