Mesa (master): mesa: add _mesa_get_list helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 21 00:30:49 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Dec 23 17:18:08 2020 -0500

mesa: add _mesa_get_list helper

glthread will use it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>

---

 src/mesa/main/dlist.c | 12 ++++++------
 src/mesa/main/dlist.h |  3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b74790f01f9..5c8985e8755 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -11351,9 +11351,9 @@ _mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
 /**
  * Test if ID names a display list.
  */
-static GLboolean
-islist(struct gl_context *ctx, GLuint list,
-       struct gl_display_list ** dlist)
+bool
+_mesa_get_list(struct gl_context *ctx, GLuint list,
+               struct gl_display_list **dlist)
 {
    struct gl_display_list * dl =
       list > 0 ? _mesa_lookup_list(ctx, list) : NULL;
@@ -11384,7 +11384,7 @@ execute_list(struct gl_context *ctx, GLuint list)
    Node *n;
    GLboolean done;
 
-   if (list == 0 || !islist(ctx, list, &dlist))
+   if (list == 0 || !_mesa_get_list(ctx, list, &dlist))
       return;
 
    if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
@@ -13624,7 +13624,7 @@ _mesa_IsList(GLuint list)
    GET_CURRENT_CONTEXT(ctx);
    FLUSH_VERTICES(ctx, 0);      /* must be called before assert */
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-   return islist(ctx, list, NULL);
+   return _mesa_get_list(ctx, list, NULL);
 }
 
 
@@ -14694,7 +14694,7 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
          return;
    }
 
-   if (!islist(ctx, list, &dlist)) {
+   if (!_mesa_get_list(ctx, list, &dlist)) {
       fprintf(f, "%u is not a display list ID\n", list);
       goto out;
    }
diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h
index 234f797ea1f..8fa09a7aec2 100644
--- a/src/mesa/main/dlist.h
+++ b/src/mesa/main/dlist.h
@@ -133,5 +133,8 @@ _mesa_init_display_list(struct gl_context * ctx);
 void
 _mesa_free_display_list_data(struct gl_context *ctx);
 
+bool
+_mesa_get_list(struct gl_context *ctx, GLuint list,
+               struct gl_display_list **dlist);
 
 #endif /* DLIST_H */



More information about the mesa-commit mailing list