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@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15765>
This commit is contained in:
Qiang Yu 2022-05-14 11:34:41 +08:00 committed by Marge Bot
parent 90b34c9184
commit 8373248cf0
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}