Mesa (master): glthread: rename inside_dlist to ListMode for future use

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


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Dec 23 12:29:24 2020 -0500

glthread: rename inside_dlist to ListMode for future use

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/mapi/glapi/gen/gl_API.xml |  4 ++--
 src/mesa/main/glthread.h      |  4 ++--
 src/mesa/main/glthread_draw.c | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 7c754b8671e..d04f4c4f1d6 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -1111,14 +1111,14 @@
     <type name="DEBUGPROC" size="4" pointer="true"/>
 
     <function name="NewList" deprecated="3.1"
-              marshal_call_after="if (COMPAT) ctx->GLThread.inside_dlist = true;">
+              marshal_call_after="if (COMPAT) ctx->GLThread.ListMode = mode;">
         <param name="list" type="GLuint"/>
         <param name="mode" type="GLenum"/>
         <glx sop="101"/>
     </function>
 
     <function name="EndList" deprecated="3.1"
-              marshal_call_after="if (COMPAT) ctx->GLThread.inside_dlist = false;">
+              marshal_call_after="if (COMPAT) ctx->GLThread.ListMode = 0;">
         <glx sop="102"/>
     </function>
 
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 62367abbfad..bc1b751c86b 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -153,8 +153,8 @@ struct glthread_state
    /** Whether GLThread is enabled. */
    bool enabled;
 
-   /** Whether GLThread is inside a display list generation. */
-   bool inside_dlist;
+   /** Display lists. */
+   GLenum ListMode; /**< Zero if not inside display list, else list mode. */
 
    /** For L3 cache pinning. */
    unsigned pin_thread_counter;
diff --git a/src/mesa/main/glthread_draw.c b/src/mesa/main/glthread_draw.c
index 263be4fe487..a534c51ab84 100644
--- a/src/mesa/main/glthread_draw.c
+++ b/src/mesa/main/glthread_draw.c
@@ -379,7 +379,7 @@ draw_arrays(GLenum mode, GLint first, GLsizei count, GLsizei instance_count,
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
    unsigned user_buffer_mask = vao->UserPointerMask & vao->BufferEnabled;
 
-   if (compiled_into_dlist && ctx->GLThread.inside_dlist) {
+   if (compiled_into_dlist && ctx->GLThread.ListMode) {
       _mesa_glthread_finish_before(ctx, "DrawArrays");
       /* Use the function that's compiled into a display list. */
       CALL_DrawArrays(ctx->CurrentServerDispatch, (mode, first, count));
@@ -492,7 +492,7 @@ _mesa_marshal_MultiDrawArrays(GLenum mode, const GLint *first,
    struct glthread_vao *vao = ctx->GLThread.CurrentVAO;
    unsigned user_buffer_mask = vao->UserPointerMask & vao->BufferEnabled;
 
-   if (ctx->GLThread.inside_dlist)
+   if (ctx->GLThread.ListMode)
       goto sync;
 
    if (draw_count >= 0 &&
@@ -764,7 +764,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
    unsigned user_buffer_mask = vao->UserPointerMask & vao->BufferEnabled;
    bool has_user_indices = vao->CurrentElementBufferName == 0;
 
-   if (compiled_into_dlist && ctx->GLThread.inside_dlist)
+   if (compiled_into_dlist && ctx->GLThread.ListMode)
       goto sync;
 
    /* Fast path when nothing needs to be done.
@@ -837,7 +837,7 @@ draw_elements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
 sync:
    _mesa_glthread_finish_before(ctx, "DrawElements");
 
-   if (compiled_into_dlist && ctx->GLThread.inside_dlist) {
+   if (compiled_into_dlist && ctx->GLThread.ListMode) {
       /* Only use the ones that are compiled into display lists. */
       if (basevertex) {
          CALL_DrawElementsBaseVertex(ctx->CurrentServerDispatch,
@@ -977,7 +977,7 @@ _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
    unsigned user_buffer_mask = vao->UserPointerMask & vao->BufferEnabled;
    bool has_user_indices = vao->CurrentElementBufferName == 0;
 
-   if (ctx->GLThread.inside_dlist)
+   if (ctx->GLThread.ListMode)
       goto sync;
 
    /* Fast path when nothing needs to be done. */



More information about the mesa-commit mailing list