Mesa (main): nir: Consistently pass the instr to nir_src_copy().
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Sep 14 18:28:24 UTC 2021
Module: Mesa
Branch: main
Commit: 22788d68eb60f049c6f7ff4a1da77d334f272886
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=22788d68eb60f049c6f7ff4a1da77d334f272886
Author: Emma Anholt <emma at anholt.net>
Date: Wed Jul 7 11:04:49 2021 -0700
nir: Consistently pass the instr to nir_src_copy().
The arg says it's supposed to be the instr, not the shader.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11776>
---
src/compiler/nir/nir_lower_phis_to_scalar.c | 2 +-
src/compiler/nir/nir_opt_undef.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
index eb7eb09bb80..e53e1773da4 100644
--- a/src/compiler/nir/nir_lower_phis_to_scalar.c
+++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
@@ -239,7 +239,7 @@ lower_phis_to_scalar_block(nir_block *block,
nir_op_mov);
nir_ssa_dest_init(&mov->instr, &mov->dest.dest, 1, bit_size, NULL);
mov->dest.write_mask = 1;
- nir_src_copy(&mov->src[0].src, &src->src, state->mem_ctx);
+ nir_src_copy(&mov->src[0].src, &src->src, &mov->instr);
mov->src[0].swizzle[0] = i;
/* Insert at the end of the predecessor but before the jump */
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
index fd8fb2c7590..27182ef3d5b 100644
--- a/src/compiler/nir/nir_opt_undef.c
+++ b/src/compiler/nir/nir_opt_undef.c
@@ -57,7 +57,7 @@ opt_undef_csel(nir_alu_instr *instr)
nir_instr_rewrite_src(&instr->instr, &instr->src[0].src,
instr->src[i == 1 ? 2 : 1].src);
nir_alu_src_copy(&instr->src[0], &instr->src[i == 1 ? 2 : 1],
- ralloc_parent(instr));
+ instr);
nir_src empty_src;
memset(&empty_src, 0, sizeof(empty_src));
More information about the mesa-commit
mailing list