summaryrefslogtreecommitdiff
path: root/src/gallium/frontends
diff options
context:
space:
mode:
authorFaith Ekstrand <faith.ekstrand@collabora.com>2023-08-17 16:27:15 -0500
committerMarge Bot <emma+marge@anholt.net>2023-08-18 01:00:15 +0000
commitb5d6b7c402a06204ba54df9cb357c89fec9db01a (patch)
treeec3f8a19844d602c4259905de7b53fe3d2fecd98 /src/gallium/frontends
parent71ddaca2e23bf5c7143f71f2ac485732b60e3124 (diff)
nir: Drop most uses if nir_instr_rewrite_src()
Generated by the following semantic patch: @@ expression I, S, D; @@ -nir_instr_rewrite_src(I, S, nir_src_for_ssa(D)); +nir_src_rewrite(S, D); Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
Diffstat (limited to 'src/gallium/frontends')
-rw-r--r--src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c2
-rw-r--r--src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c b/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c
index 2ea97f4500a..0788f9e7bbe 100644
--- a/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c
+++ b/src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c
@@ -71,7 +71,7 @@ try_lower_input_load(nir_intrinsic_instr *load, bool use_fragcoord_sysval)
nir_def *coord =
nir_vec4(&b, nir_channel(&b, pos, 0), nir_channel(&b, pos, 1), layer, nir_imm_int(&b, 0));
- nir_instr_rewrite_src(&load->instr, &load->src[1], nir_src_for_ssa(coord));
+ nir_src_rewrite(&load->src[1], coord);
return true;
}
diff --git a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
index c635cc9f541..f50f2a2d58d 100644
--- a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
+++ b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c
@@ -171,10 +171,10 @@ lower_load_ubo(nir_builder *b, nir_instr *instr, void *data_cb)
b->cursor = nir_before_instr(instr);
- nir_instr_rewrite_src(instr, &intrin->src[0], nir_src_for_ssa(nir_imm_int(b, binding.desc_set + 1)));
+ nir_src_rewrite(&intrin->src[0], nir_imm_int(b, binding.desc_set + 1));
nir_def *offset = nir_iadd_imm(b, intrin->src[1].ssa, bind_layout->uniform_block_offset);
- nir_instr_rewrite_src(instr, &intrin->src[1], nir_src_for_ssa(offset));
+ nir_src_rewrite(&intrin->src[1], offset);
return true;
}
@@ -198,8 +198,7 @@ static nir_def *lower_vri_instr(struct nir_builder *b,
/* Ignore the offset component. */
b->cursor = nir_before_instr(instr);
nir_def *resource = nir_ssa_for_src(b, intrin->src[0], 2);
- nir_instr_rewrite_src(&intrin->instr, &intrin->src[0],
- nir_src_for_ssa(resource));
+ nir_src_rewrite(&intrin->src[0], resource);
return NULL;
}
case nir_intrinsic_image_deref_sparse_load: