summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-01-02 14:12:04 -0800
committerTimothy Arceri <[email protected]>2017-03-16 14:14:18 +1100
commitefd63e234a805edc8b1c9962610d70d3a62f7c18 (patch)
tree1fec22426419385caafc5c0e3a520a4f1906ad66
parentdb06e91de205eff036cd6a2d48f41573f6a9535c (diff)
mesa: Connect the generated GL command marshalling code to the build.
v2: Rebase on the Begin/End changes, and just disable this feature on non-GL-core. v3: (Timothy Arceri) enable for non-GL-core contexts. Remove unrelated safe_mul() hunk. while loop style fix. 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]>
-rw-r--r--src/mesa/Makefile.sources2
-rw-r--r--src/mesa/main/glthread.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index b2d078368a4..134d5e94f52 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -132,6 +132,8 @@ MAIN_FILES = \
main/lines.c \
main/lines.h \
main/macros.h \
+ main/marshal_generated.c \
+ main/marshal_generated.h \
main/matrix.c \
main/matrix.h \
main/mipmap.c \
diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c
index 8877a695f0c..c4d1031f4c6 100644
--- a/src/mesa/main/glthread.c
+++ b/src/mesa/main/glthread.c
@@ -54,8 +54,15 @@ glthread_allocate_batch(struct gl_context *ctx)
static void
glthread_unmarshal_batch(struct gl_context *ctx, struct glthread_batch *batch)
{
+ size_t pos = 0;
+
_glapi_set_dispatch(ctx->CurrentServerDispatch);
+ while (pos < batch->used)
+ pos += _mesa_unmarshal_dispatch_cmd(ctx, &batch->buffer[pos]);
+
+ assert(pos == batch->used);
+
free(batch->buffer);
free(batch);
}
@@ -112,6 +119,14 @@ _mesa_glthread_init(struct gl_context *ctx)
if (!glthread)
return;
+ ctx->MarshalExec = _mesa_create_marshal_table(ctx);
+ if (!ctx->MarshalExec) {
+ free(glthread);
+ return;
+ }
+
+ ctx->CurrentClientDispatch = ctx->MarshalExec;
+
pthread_mutex_init(&glthread->mutex, NULL);
pthread_cond_init(&glthread->new_work, NULL);
pthread_cond_init(&glthread->work_done, NULL);