From dae902e11ef47ae49062b6a38d4d425d4fef44ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 10 Aug 2022 00:27:22 -0400 Subject: [PATCH] mesa: rename CurrentClientDispatch to GLApi I like this more. The name self-documents itself. It's always equal to the dispatch set in glapi. GLAPI is a definition, so can't use that. Acked-by: Adam Jackson Part-of: --- src/mapi/glapi/gen/gl_apitemp.py | 4 ++-- src/mesa/main/context.c | 4 ++-- src/mesa/main/dlist.c | 8 ++++---- src/mesa/main/glthread.c | 8 ++++---- src/mesa/main/mtypes.h | 2 +- src/mesa/vbo/vbo_exec_api.c | 16 ++++++++-------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py index 429b8504658..d7e25805686 100644 --- a/src/mapi/glapi/gen/gl_apitemp.py +++ b/src/mapi/glapi/gen/gl_apitemp.py @@ -134,10 +134,10 @@ class PrintGlOffsets(gl_XML.gl_print_base): * #define KEYWORD2 * #define NAME(func) gl##func * #define DISPATCH(func, args, msg) \\ - * struct _glapi_table *dispatch = CurrentClientDispatch; \\ + * struct _glapi_table *dispatch = GLApi; \\ * (*dispatch->func) args * #define RETURN DISPATCH(func, args, msg) \\ - * struct _glapi_table *dispatch = CurrentClientDispatch; \\ + * struct _glapi_table *dispatch = GLApi; \\ * return (*dispatch->func) args * */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ff06ca5922f..3573f5bbf43 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1009,7 +1009,7 @@ _mesa_initialize_context(struct gl_context *ctx, if (!ctx->Dispatch.OutsideBeginEnd) goto fail; ctx->Dispatch.Exec = ctx->Dispatch.OutsideBeginEnd; - ctx->CurrentClientDispatch = ctx->Dispatch.Current = ctx->Dispatch.OutsideBeginEnd; + ctx->GLApi = ctx->Dispatch.Current = ctx->Dispatch.OutsideBeginEnd; _mesa_reset_vertex_processing_mode(ctx); @@ -1482,7 +1482,7 @@ _mesa_make_current( struct gl_context *newCtx, else { _glapi_set_context((void *) newCtx); assert(_mesa_get_current_context() == newCtx); - _glapi_set_dispatch(newCtx->CurrentClientDispatch); + _glapi_set_dispatch(newCtx->GLApi); if (drawBuffer && readBuffer) { assert(_mesa_is_winsys_fbo(drawBuffer)); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index e938789fad8..9d60f9d3991 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -13203,7 +13203,7 @@ _mesa_NewList(GLuint name, GLenum mode) ctx->Dispatch.Current = ctx->Dispatch.Save; _glapi_set_dispatch(ctx->Dispatch.Current); if (!ctx->GLThread.enabled) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current; + ctx->GLApi = ctx->Dispatch.Current; } } @@ -13415,7 +13415,7 @@ _mesa_EndList(void) ctx->Dispatch.Current = ctx->Dispatch.Exec; _glapi_set_dispatch(ctx->Dispatch.Current); if (!ctx->GLThread.enabled) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current; + ctx->GLApi = ctx->Dispatch.Current; } } @@ -13456,7 +13456,7 @@ _mesa_CallList(GLuint list) if (save_compile_flag) { ctx->Dispatch.Current = ctx->Dispatch.Save; if (!ctx->GLThread.enabled) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current; + ctx->GLApi = ctx->Dispatch.Current; } } } @@ -13579,7 +13579,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) if (save_compile_flag) { ctx->Dispatch.Current = ctx->Dispatch.Save; if (!ctx->GLThread.enabled) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current; + ctx->GLApi = ctx->Dispatch.Current; } } } diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 7fb9816eebd..5070b58aa7b 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -254,11 +254,11 @@ void _mesa_glthread_enable(struct gl_context *ctx) return; ctx->GLThread.enabled = true; - ctx->CurrentClientDispatch = ctx->MarshalExec; + ctx->GLApi = ctx->MarshalExec; /* Update the dispatch only if the dispatch is current. */ if (_glapi_get_dispatch() == ctx->Dispatch.Current) { - _glapi_set_dispatch(ctx->CurrentClientDispatch); + _glapi_set_dispatch(ctx->GLApi); } } @@ -270,11 +270,11 @@ void _mesa_glthread_disable(struct gl_context *ctx) _mesa_glthread_finish(ctx); ctx->GLThread.enabled = false; - ctx->CurrentClientDispatch = ctx->Dispatch.Current; + ctx->GLApi = ctx->Dispatch.Current; /* Update the dispatch only if the dispatch is current. */ if (_glapi_get_dispatch() == ctx->MarshalExec) { - _glapi_set_dispatch(ctx->CurrentClientDispatch); + _glapi_set_dispatch(ctx->GLApi); } /* Unbind VBOs in all VAOs that glthread bound for non-VBO vertex uploads diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 618b6337fff..29c95c036c1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3301,7 +3301,7 @@ struct gl_context * program. If API calls are being marshalled to another thread, this == * MarshalExec. Otherwise it == Dispatch.Current. */ - struct _glapi_table *CurrentClientDispatch; + struct _glapi_table *GLApi; /*@}*/ diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 0e97dd5e6a7..1173157d258 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -860,11 +860,11 @@ _mesa_Begin(GLenum mode) if (ctx->GLThread.enabled) { if (ctx->Dispatch.Current == ctx->Dispatch.OutsideBeginEnd) ctx->Dispatch.Current = ctx->Dispatch.Exec; - } else if (ctx->CurrentClientDispatch == ctx->Dispatch.OutsideBeginEnd) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current = ctx->Dispatch.Exec; - _glapi_set_dispatch(ctx->CurrentClientDispatch); + } else if (ctx->GLApi == ctx->Dispatch.OutsideBeginEnd) { + ctx->GLApi = ctx->Dispatch.Current = ctx->Dispatch.Exec; + _glapi_set_dispatch(ctx->GLApi); } else { - assert(ctx->CurrentClientDispatch == ctx->Dispatch.Save); + assert(ctx->GLApi == ctx->Dispatch.Save); } } @@ -922,10 +922,10 @@ _mesa_End(void) ctx->Dispatch.Current == ctx->Dispatch.HWSelectModeBeginEnd) { ctx->Dispatch.Current = ctx->Dispatch.Exec; } - } else if (ctx->CurrentClientDispatch == ctx->Dispatch.BeginEnd || - ctx->CurrentClientDispatch == ctx->Dispatch.HWSelectModeBeginEnd) { - ctx->CurrentClientDispatch = ctx->Dispatch.Current = ctx->Dispatch.Exec; - _glapi_set_dispatch(ctx->CurrentClientDispatch); + } else if (ctx->GLApi == ctx->Dispatch.BeginEnd || + ctx->GLApi == ctx->Dispatch.HWSelectModeBeginEnd) { + ctx->GLApi = ctx->Dispatch.Current = ctx->Dispatch.Exec; + _glapi_set_dispatch(ctx->GLApi); } if (exec->vtx.prim_count > 0) {