glthread: rename inside_dlist to ListMode for future use
authorMarek Olšák <marek.olsak@amd.com>
Wed, 23 Dec 2020 17:29:24 +0000 (12:29 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 Jan 2021 00:12:35 +0000 (00:12 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>

src/mapi/glapi/gen/gl_API.xml
src/mesa/main/glthread.h
src/mesa/main/glthread_draw.c

index 7c754b8..d04f4c4 100644 (file)
     <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>
 
index 62367ab..bc1b751 100644 (file)
@@ -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;
index 263be4f..a534c51 100644 (file)
@@ -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. */