summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2018-04-06 08:28:53 -0400
committerRob Clark <robdclark@gmail.com>2018-04-09 15:36:21 -0400
commitc4457113e9327ce16e56fbf5a38a694e04849ab3 (patch)
treef27de000d1f69cb387124a48ad1be90662eabd25
parent1d94aa19877fb702ffacacde28ad7253cce72c97 (diff)
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 <robdclark@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--src/compiler/nir/nir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 8364197480..ef911540f3 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -212,6 +212,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;