projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
024c49e
)
nir/cursor: Add a helper for getting the current block
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Mon, 31 Aug 2015 21:48:10 +0000
(14:48 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Tue, 1 Sep 2015 00:05:23 +0000
(17:05 -0700)
src/glsl/nir/nir.h
patch
|
blob
|
history
diff --git
a/src/glsl/nir/nir.h
b/src/glsl/nir/nir.h
index ac80af37bae3deadb375c1f0211f41e01e5ff958..2ad739523baa189d346a2a1b4410d9b2ca2c4d4a 100644
(file)
--- a/
src/glsl/nir/nir.h
+++ b/
src/glsl/nir/nir.h
@@
-1580,6
+1580,17
@@
typedef struct {
};
} nir_cursor;
+static inline nir_block *
+nir_cursor_current_block(nir_cursor cursor)
+{
+ if (cursor.option == nir_cursor_before_instr ||
+ cursor.option == nir_cursor_after_instr) {
+ return cursor.instr->block;
+ } else {
+ return cursor.block;
+ }
+}
+
static inline nir_cursor
nir_before_block(nir_block *block)
{