X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fglapi%2Fgen%2Fgl_marshal.py;h=c12a086942bb93405a3fbf8a80f6b6be609d14ec;hb=9dbf5ec9f7844dda9d2473a3168e3f8b0009a66d;hp=9d5d5ad9e2718fe1efc38a5d849648991aaf0ec1;hpb=245f9593b7967521bd6661d7059096c528cc7f0d;p=mesa.git diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 9d5d5ad9e27..c12a086942b 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -35,7 +35,6 @@ header = """ #include "dispatch.h" #include "glthread.h" #include "marshal.h" -#include "marshal_generated.h" """ @@ -238,7 +237,7 @@ class PrintCode(gl_XML.gl_print_base): if p.img_null_flag: size = '({0} ? {1} : 0)'.format(p.name, size) size_terms.append(size) - out('size_t cmd_size = {0};'.format(' + '.join(size_terms))) + out('int cmd_size = {0};'.format(' + '.join(size_terms))) out('{0} *cmd;'.format(struct)) out('debug_print_marshal("{0}");'.format(func.name)) @@ -282,31 +281,14 @@ class PrintCode(gl_XML.gl_print_base): out('') def print_unmarshal_dispatch_cmd(self, api): - out('size_t') - out('_mesa_unmarshal_dispatch_cmd(struct gl_context *ctx, ' - 'const void *cmd)') - out('{') + out('const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD] = {') with indent(): - out('const struct marshal_cmd_base *cmd_base = cmd;') - out('switch (cmd_base->cmd_id) {') for func in api.functionIterateAll(): flavor = func.marshal_flavor() if flavor in ('skip', 'sync'): continue - out('case DISPATCH_CMD_{0}:'.format(func.name)) - with indent(): - out('debug_print_unmarshal("{0}");'.format(func.name)) - out(('_mesa_unmarshal_{0}(ctx, (const struct marshal_cmd_{0} *)' - ' cmd);').format(func.name)) - out('break;') - out('default:') - with indent(): - out('assert(!"Unrecognized command ID");') - out('break;') - out('}') - out('') - out('return cmd_base->cmd_size;') - out('}') + out('[DISPATCH_CMD_{0}] = (_mesa_unmarshal_func)_mesa_unmarshal_{0},'.format(func.name)) + out('};') out('') out('')