diff options
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 10 |
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) { |