From ef30ce97a6bc0a9a6e625df6964e1cdea0ccee4b Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Wed, 3 Oct 2012 15:39:52 -0700 Subject: mesa: Create pointers for multithread marshalling dispatch table. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch splits the context's CurrentDispatch pointer into two pointers, CurrentClientDispatch, and CurrentServerDispatch, so that when doing multithread marshalling, we can distinguish between the dispatch table that's being used by the client (to serialize GL calls into the marshal buffer) and the dispatch table that's being used by the server (to execute the GL calls). Acked-by: Timothy Arceri Acked-by: Marek Olšák Tested-by: Dieter Nützel Tested-by: Mike Lothian --- src/mesa/main/glthread.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa/main/glthread.c') diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 76eb0cf7dac..8877a695f0c 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -54,6 +54,8 @@ glthread_allocate_batch(struct gl_context *ctx) static void glthread_unmarshal_batch(struct gl_context *ctx, struct glthread_batch *batch) { + _glapi_set_dispatch(ctx->CurrentServerDispatch); + free(batch->buffer); free(batch); } @@ -156,6 +158,10 @@ _mesa_glthread_destroy(struct gl_context *ctx) free(glthread); ctx->GLThread = NULL; + + /* Remove ourselves from the dispatch table. */ + ctx->CurrentClientDispatch = ctx->CurrentServerDispatch; + _glapi_set_dispatch(ctx->CurrentClientDispatch); } void @@ -183,6 +189,7 @@ _mesa_glthread_flush_batch(struct gl_context *ctx) */ if (false) { glthread_unmarshal_batch(ctx, batch); + _glapi_set_dispatch(ctx->CurrentClientDispatch); return; } -- cgit v1.2.3