From c182ab2b8349402d2736ce97119c85dd89668ee8 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 13 Aug 2023 09:27:28 -0400 Subject: [PATCH] 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: --- src/compiler/nir/nir_lower_input_attachments.c | 2 +- src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.7.4