diff options
author | Kenneth Graunke <[email protected]> | 2019-04-08 11:10:08 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-04-28 22:35:42 -0700 |
commit | 08dc93c67c7d599a09cf353d50a3f0cf72f76135 (patch) | |
tree | 352b88a7cbb95173be3f3acf766d5477be36cf25 | |
parent | 376c3e8f87ab0b9bce5182da60c59832f7c1c138 (diff) |
glsl/list: Add an exec_list_is_singular() helper.
Similar to list_is_singular() in util/list.h.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r-- | src/compiler/glsl/list.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/glsl/list.h b/src/compiler/glsl/list.h index 979f6fcc539..ed77dcfab41 100644 --- a/src/compiler/glsl/list.h +++ b/src/compiler/glsl/list.h @@ -372,6 +372,13 @@ exec_list_is_empty(const struct exec_list *list) return list->head_sentinel.next == &list->tail_sentinel; } +static inline bool +exec_list_is_singular(const struct exec_list *list) +{ + return !exec_list_is_empty(list) && + list->head_sentinel.next->next == &list->tail_sentinel; +} + static inline const struct exec_node * exec_list_get_head_const(const struct exec_list *list) { |