[Mesa-dev] [PATCH 4.5/7] nir: add list_head to nir_src::ssa

Rob Clark robdclark at gmail.com
Mon Oct 26 08:26:29 PDT 2015


From: Rob Clark <robclark at freedesktop.org>

This will be used by clone.  Possibly useful elsewhere.  The list link
will only be valid in ssa case, it fits in the padding in the union
left from the larger nir_reg_src.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/glsl/nir/nir.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 2d9c94c..fb60340 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -528,7 +528,12 @@ typedef struct nir_src {
 
    union {
       nir_reg_src reg;
-      nir_ssa_def *ssa;
+      struct {
+         /* used in clone to track unresolved ssa src's: */
+         struct list_head link;
+
+         nir_ssa_def *ssa;
+      };
    };
 
    bool is_ssa;
-- 
2.5.0



More information about the mesa-dev mailing list