From: Pierre-Eric Pelloux-Prayer Date: Mon, 30 Nov 2020 16:32:06 +0000 (+0100) Subject: glthread: use custom marshal/unmarshal for CallList X-Git-Tag: upstream/21.2.3~687 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0536119f2ef785603ca8fbc59e097f344e0b1fc;p=platform%2Fupstream%2Fmesa.git glthread: use custom marshal/unmarshal for CallList Will be used in the next commit. Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 1d5575f..cf5a0f0 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -1122,8 +1122,7 @@ - + diff --git a/src/mesa/main/glthread_list.c b/src/mesa/main/glthread_list.c new file mode 100644 index 0000000..af4b1283 --- /dev/null +++ b/src/mesa/main/glthread_list.c @@ -0,0 +1,47 @@ +/* + * Copyright © 2020 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "c99_alloca.h" + +#include "main/glthread_marshal.h" +#include "main/dispatch.h" + +uint32_t +_mesa_unmarshal_CallList(struct gl_context *ctx, const struct marshal_cmd_CallList *cmd, const uint64_t *last) +{ + const GLuint list = cmd->list; + CALL_CallList(ctx->CurrentServerDispatch, (list)); + return cmd->cmd_base.cmd_size; +} + +void GLAPIENTRY +_mesa_marshal_CallList(GLuint list) +{ + GET_CURRENT_CONTEXT(ctx); + int cmd_size = sizeof(struct marshal_cmd_CallList); + struct marshal_cmd_CallList *cmd; + cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CallList, cmd_size); + cmd->list = list; + + _mesa_glthread_CallList(ctx, list); +} diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 2b9bab2..b7f5cc9 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -721,4 +721,10 @@ _mesa_glthread_DeleteLists(struct gl_context *ctx, GLsizei range) _mesa_glthread_flush_batch(ctx); } +struct marshal_cmd_CallList +{ + struct marshal_cmd_base cmd_base; + GLuint list; +}; + #endif /* MARSHAL_H */ diff --git a/src/mesa/meson.build b/src/mesa/meson.build index 05818f0..2f29012 100644 --- a/src/mesa/meson.build +++ b/src/mesa/meson.build @@ -167,6 +167,7 @@ files_libmesa_common = files( 'main/glthread_bufferobj.c', 'main/glthread_draw.c', 'main/glthread_get.c', + 'main/glthread_list.c', 'main/glthread_marshal.h', 'main/glthread_shaderobj.c', 'main/glthread_varray.c',