nir: add comment about nir_src_copy()
authorRob Clark <robdclark@gmail.com>
Fri, 6 Apr 2018 12:28:53 +0000 (08:28 -0400)
committerRob Clark <robdclark@gmail.com>
Mon, 9 Apr 2018 19:36:21 +0000 (15:36 -0400)
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>
src/compiler/nir/nir.c

index 8364197480b9341a04436ab458aa294e111fe043..ef911540f3793adef708d336d3c4d0c312cc2433 100644 (file)
@@ -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;