summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-01-02 14:12:04 -0800
committerEric Anholt <eric@anholt.net>2013-01-03 11:58:21 -0800
commit57b451b4db8cf7cf67dda50f7b013643568cae5c (patch)
treecd31fb4ab690dda25abfbd63a77f9d52ebc1de93
parent3aed45fa4c782c283038154f7e1cfb17c98207be (diff)
mesa: Connect the generated GL command marshalling code to the build.
-rw-r--r--src/mesa/SConscript1
-rw-r--r--src/mesa/main/glthread.c16
-rw-r--r--src/mesa/sources.mak2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 1ee6e8219cf..745b7d55b60 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -88,6 +88,7 @@ main_sources = [
'main/imports.c',
'main/light.c',
'main/lines.c',
+ 'main/marshal_generated.c',
'main/matrix.c',
'main/mipmap.c',
'main/mm.c',
diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c
index 336c8d6dd02..1aa0f4f9a8b 100644
--- a/src/mesa/main/glthread.c
+++ b/src/mesa/main/glthread.c
@@ -73,8 +73,16 @@ _mesa_glthread_allocate_command(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);
}
@@ -129,6 +137,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);
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 1c1da6d7382..bc10d6462ea 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -58,6 +58,8 @@ MAIN_FILES = \
$(SRCDIR)main/imports.c \
$(SRCDIR)main/light.c \
$(SRCDIR)main/lines.c \
+ $(SRCDIR)main/marshal_generated.c \
+ $(SRCDIR)main/marshal_generated.h \
$(SRCDIR)main/matrix.c \
$(SRCDIR)main/mipmap.c \
$(SRCDIR)main/mm.c \