diff options
author | Paul Berry <[email protected]> | 2012-10-03 15:39:52 -0700 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-16 14:14:18 +1100 |
commit | ef30ce97a6bc0a9a6e625df6964e1cdea0ccee4b (patch) | |
tree | 79491b67563fa5c631a9675092d10f26dff3ea79 /src/mesa/main/context.c | |
parent | d8d81fbc31619f6ecf0a1b5ded22e5576e1d1739 (diff) |
mesa: Create pointers for multithread marshalling dispatch table.
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 <[email protected]>
Acked-by: Marek Olšák <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 95a337b14bc..4b654de4582 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1213,7 +1213,7 @@ _mesa_initialize_context(struct gl_context *ctx, if (!ctx->OutsideBeginEnd) goto fail; ctx->Exec = ctx->OutsideBeginEnd; - ctx->CurrentDispatch = ctx->OutsideBeginEnd; + ctx->CurrentClientDispatch = ctx->CurrentServerDispatch = ctx->OutsideBeginEnd; ctx->FragmentProgram._MaintainTexEnvProgram = (getenv("MESA_TEX_PROG") != NULL); @@ -1342,6 +1342,7 @@ _mesa_free_context_data( struct gl_context *ctx ) free(ctx->OutsideBeginEnd); free(ctx->Save); free(ctx->ContextLost); + free(ctx->MarshalExec); /* Shared context state (display lists, textures, etc) */ _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); @@ -1666,7 +1667,7 @@ _mesa_make_current( struct gl_context *newCtx, } } else { - _glapi_set_dispatch(newCtx->CurrentDispatch); + _glapi_set_dispatch(newCtx->CurrentClientDispatch); if (drawBuffer && readBuffer) { assert(_mesa_is_winsys_fbo(drawBuffer)); @@ -1768,19 +1769,19 @@ _mesa_get_current_context( void ) /** * Get context's current API dispatch table. * - * It'll either be the immediate-mode execute dispatcher or the display list - * compile dispatcher. + * It'll either be the immediate-mode execute dispatcher, the display list + * compile dispatcher, or the thread marshalling dispatcher. * * \param ctx GL context. * * \return pointer to dispatch_table. * - * Simply returns __struct gl_contextRec::CurrentDispatch. + * Simply returns __struct gl_contextRec::CurrentClientDispatch. */ struct _glapi_table * _mesa_get_dispatch(struct gl_context *ctx) { - return ctx->CurrentDispatch; + return ctx->CurrentClientDispatch; } /*@}*/ |