summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-07-15 12:00:47 -0700
committerConnor Abbott <[email protected]>2015-07-17 09:47:22 -0700
commit8eea091747c9b12b21688b738145632b90d923cb (patch)
treef1f74b60ccea0fce997e1967e61e834c242b4de4
parent01cdbba341b47972a743e7f192d3554010d0da84 (diff)
nir: add nir_instr_is_first() and nir_instr_is_last() helpers
Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Connor Abbott <[email protected]>
-rw-r--r--src/glsl/nir/nir.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index e9a506c5971..0db1fc3076e 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -443,6 +443,18 @@ nir_instr_prev(nir_instr *instr)
return exec_node_data(nir_instr, prev, node);
}
+static inline bool
+nir_instr_is_first(nir_instr *instr)
+{
+ return exec_node_is_head_sentinel(exec_node_get_prev(&instr->node));
+}
+
+static inline bool
+nir_instr_is_last(nir_instr *instr)
+{
+ return exec_node_is_tail_sentinel(exec_node_get_next(&instr->node));
+}
+
typedef struct {
/** for debugging only, can be NULL */
const char* name;