mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
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 <tarceri@itsqueeze.com>
Acked-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
This commit is contained in:
parent
db06e91de2
commit
efd63e234a
2 changed files with 17 additions and 0 deletions
|
|
@ -132,6 +132,8 @@ MAIN_FILES = \
|
||||||
main/lines.c \
|
main/lines.c \
|
||||||
main/lines.h \
|
main/lines.h \
|
||||||
main/macros.h \
|
main/macros.h \
|
||||||
|
main/marshal_generated.c \
|
||||||
|
main/marshal_generated.h \
|
||||||
main/matrix.c \
|
main/matrix.c \
|
||||||
main/matrix.h \
|
main/matrix.h \
|
||||||
main/mipmap.c \
|
main/mipmap.c \
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,15 @@ glthread_allocate_batch(struct gl_context *ctx)
|
||||||
static void
|
static void
|
||||||
glthread_unmarshal_batch(struct gl_context *ctx, struct glthread_batch *batch)
|
glthread_unmarshal_batch(struct gl_context *ctx, struct glthread_batch *batch)
|
||||||
{
|
{
|
||||||
|
size_t pos = 0;
|
||||||
|
|
||||||
_glapi_set_dispatch(ctx->CurrentServerDispatch);
|
_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->buffer);
|
||||||
free(batch);
|
free(batch);
|
||||||
}
|
}
|
||||||
|
|
@ -112,6 +119,14 @@ _mesa_glthread_init(struct gl_context *ctx)
|
||||||
if (!glthread)
|
if (!glthread)
|
||||||
return;
|
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_mutex_init(&glthread->mutex, NULL);
|
||||||
pthread_cond_init(&glthread->new_work, NULL);
|
pthread_cond_init(&glthread->new_work, NULL);
|
||||||
pthread_cond_init(&glthread->work_done, NULL);
|
pthread_cond_init(&glthread->work_done, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue