From 8373248cf01f8e631f11346f97b864a3a37ead9d Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Sat, 14 May 2022 11:34:41 +0800 Subject: [PATCH] mesa: set CurrentServerDispatch too when glBegin/End MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Qiang Yu Part-of: --- 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); }