Re: [Mesa-dev] [PATCH 02/16] nir: add comment about nir_src_copy()
Rb On April 7, 2018 09:14:03 Rob Clark wrote: So it is more clear about when to use nir_instr_rewrite_src() Signed-off-by: Rob Clark --- An assert would be nice too, but wasn't sure how to differentiate between the parent_instr and parent_if case. src/compiler/nir/nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index a827fe00e11..0f6cec728b0 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -207,6 +207,9 @@ nir_function_create(nir_shader *shader, const char *name) return func; } +/* NOTE: if the instruction you are copying a src to is already added + * to the IR, use nir_instr_rewrite_src() instead. + */ void nir_src_copy(nir_src *dest, const nir_src *src, void *mem_ctx) { dest->is_ssa = src->is_ssa; -- 2.14.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/16] nir: add comment about nir_src_copy()
So it is more clear about when to use nir_instr_rewrite_src() Signed-off-by: Rob Clark --- An assert would be nice too, but wasn't sure how to differentiate between the parent_instr and parent_if case. src/compiler/nir/nir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index a827fe00e11..0f6cec728b0 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -207,6 +207,9 @@ nir_function_create(nir_shader *shader, const char *name) return func; } +/* NOTE: if the instruction you are copying a src to is already added + * to the IR, use nir_instr_rewrite_src() instead. + */ void nir_src_copy(nir_src *dest, const nir_src *src, void *mem_ctx) { dest->is_ssa = src->is_ssa; -- 2.14.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev