mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
nir: add nir_instr_is_first() and nir_instr_is_last() helpers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Signed-off-by: Connor Abbott <connor.w.abbott@intel.com>
This commit is contained in:
parent
01cdbba341
commit
8eea091747
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue