summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-04-02 11:07:48 -0700
committerJason Ekstrand <[email protected]>2015-04-03 14:04:12 -0700
commit7bdba4a24583f4cc2f9bca94f975cec9d384cddc (patch)
treea5863f743e6c466fd1c1e421b01388544074ae4c /src/glsl
parentcb966fb2bea77b1d7b1bdb6597b7b85d810f2d0a (diff)
nir: Add a src_get_parent_instr function
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 6e2aa97d498..0509e64e1e2 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -529,6 +529,16 @@ nir_src_for_reg(nir_register *reg)
return src;
}
+static inline nir_instr *
+nir_src_get_parent_instr(const nir_src *src)
+{
+ if (src->is_ssa) {
+ return src->ssa->parent_instr;
+ } else {
+ return src->reg.reg->parent_instr;
+ }
+}
+
static inline nir_dest
nir_dest_for_reg(nir_register *reg)
{