Mesa (main): mesa: set CurrentServerDispatch too when glBegin/End

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 6 19:05:07 UTC 2022


Module: Mesa
Branch: main
Commit: 8373248cf01f8e631f11346f97b864a3a37ead9d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8373248cf01f8e631f11346f97b864a3a37ead9d

Author: Qiang Yu <yuq825 at gmail.com>
Date:   Sat May 14 11:34:41 2022 +0800

mesa: set CurrentServerDispatch too when glBegin/End

When glthread not enabled, CurrentClientDispatch and CurrentServerDispatch
should be same. This does not cause problems before because OutsideBeginEnd
and BeginEnd have same BeginEnd entries, so when
CurrentServerDispatch==OutsideBeginEnd
CurrentClientDispatch==BeginEnd
will call into same BeginEnd _mesa_* functions.

But we'll add another dispatch table to replace BeginEnd when HW GL_SELECT
mode, so this needs to be fixed. Otherwise some function like _mesa_Rectf
which always call with CurrentServerDispatch will go into wrong entries.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Signed-off-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15765>

---

 src/mesa/vbo/vbo_exec_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 83c1a5eea37..806cd6c60f8 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -850,7 +850,7 @@ _mesa_Begin(GLenum mode)
    if (ctx->GLThread.enabled) {
       ctx->CurrentServerDispatch = ctx->Exec;
    } else if (ctx->CurrentClientDispatch == ctx->OutsideBeginEnd) {
-      ctx->CurrentClientDispatch = ctx->Exec;
+      ctx->CurrentClientDispatch = ctx->CurrentServerDispatch = ctx->Exec;
       _glapi_set_dispatch(ctx->CurrentClientDispatch);
    } else {
       assert(ctx->CurrentClientDispatch == ctx->Save);
@@ -909,7 +909,7 @@ _mesa_End(void)
    if (ctx->GLThread.enabled) {
       ctx->CurrentServerDispatch = ctx->Exec;
    } else if (ctx->CurrentClientDispatch == ctx->BeginEnd) {
-      ctx->CurrentClientDispatch = ctx->Exec;
+      ctx->CurrentClientDispatch = ctx->CurrentServerDispatch = ctx->Exec;
       _glapi_set_dispatch(ctx->CurrentClientDispatch);
    }
 



More information about the mesa-commit mailing list