Mesa (master): glsl/list: Add an exec_list_is_singular() helper.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 29 06:50:08 UTC 2019


Module: Mesa
Branch: master
Commit: 08dc93c67c7d599a09cf353d50a3f0cf72f76135
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=08dc93c67c7d599a09cf353d50a3f0cf72f76135

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Apr  8 11:10:08 2019 -0700

glsl/list: Add an exec_list_is_singular() helper.

Similar to list_is_singular() in util/list.h.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/compiler/glsl/list.h | 7 +++++++
 1 file changed, 7 insertions(+)

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)
 {




More information about the mesa-commit mailing list