summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-04-04 20:40:33 -0400
committerJason Ekstrand <[email protected]>2018-06-22 20:54:00 -0700
commit95683bdce347cb706453479b660b05cda738ade4 (patch)
treed239a4350a933b84951917a51e61642df764f413 /src/compiler/nir/nir.h
parent5a02ffb733eccb03fdfa568cc33a231d9210c4ae (diff)
nir: promote intrinsic_get_var() to helper
Useful in a few other places.. let's not copy-pasta Signed-off-by: Rob Clark <[email protected]> Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r--src/compiler/nir/nir.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 6f2f65848f2..80210945c9b 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1111,6 +1111,12 @@ typedef struct {
nir_src src[];
} nir_intrinsic_instr;
+static inline nir_variable *
+nir_intrinsic_get_var(nir_intrinsic_instr *intrin, unsigned i)
+{
+ return nir_deref_instr_get_variable(nir_src_as_deref(intrin->src[i]));
+}
+
/**
* \name NIR intrinsics semantic flags
*