From cadddbd26932a2eb4f8376e748c1cc27741afc33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 5 Mar 2020 16:21:00 -0500 Subject: [PATCH] glthread: declare marshal and unmarshal functions as non-static Declare them in the header file. Then we can split marshal_generated.c into multiple files. Reviewed-by: Alyssa Rosenzweig --- src/mapi/glapi/gen/gl_marshal.py | 6 +++--- src/mapi/glapi/gen/gl_marshal_h.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 9f19c914300..d2704e43db2 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -94,7 +94,7 @@ class PrintCode(gl_XML.gl_print_base): def print_sync_body(self, func): out('/* {0}: marshalled synchronously */'.format(func.name)) - out('static {0} GLAPIENTRY'.format(func.return_type)) + out('{0} GLAPIENTRY'.format(func.return_type)) out('_mesa_marshal_{0}({1})'.format(func.name, func.get_parameter_string())) out('{') with indent(): @@ -172,7 +172,7 @@ class PrintCode(gl_XML.gl_print_base): out('};') def print_async_unmarshal(self, func): - out('static void') + out('void') out(('_mesa_unmarshal_{0}(struct gl_context *ctx, ' 'const struct marshal_cmd_{0} *cmd)').format(func.name)) out('{') @@ -240,7 +240,7 @@ class PrintCode(gl_XML.gl_print_base): out('}') def print_async_marshal(self, func): - out('static void GLAPIENTRY') + out('void GLAPIENTRY') out('_mesa_marshal_{0}({1})'.format( func.name, func.get_parameter_string())) out('{') diff --git a/src/mapi/glapi/gen/gl_marshal_h.py b/src/mapi/glapi/gen/gl_marshal_h.py index 8a23b146e0e..6372e4a5602 100644 --- a/src/mapi/glapi/gen/gl_marshal_h.py +++ b/src/mapi/glapi/gen/gl_marshal_h.py @@ -30,12 +30,12 @@ import sys header = """ -#ifndef MARSHAL_GENERATABLE_H -#define MARSHAL_GENERATABLE_H +#ifndef MARSHAL_GENERATED_H +#define MARSHAL_GENERATED_H """ footer = """ -#endif /* MARSHAL_GENERATABLE_H */ +#endif /* MARSHAL_GENERATED_H */ """ @@ -54,6 +54,8 @@ class PrintCode(gl_XML.gl_print_base): print(footer) def printBody(self, api): + print('#include "GL/gl.h"') + print('') print('enum marshal_dispatch_cmd_id') print('{') for func in api.functionIterateAll(): @@ -67,11 +69,13 @@ class PrintCode(gl_XML.gl_print_base): for func in api.functionIterateAll(): flavor = func.marshal_flavor() - if flavor == 'custom': + if flavor in ('custom', 'async'): print('struct marshal_cmd_{0};'.format(func.name)) print(('void _mesa_unmarshal_{0}(struct gl_context *ctx, ' 'const struct marshal_cmd_{0} *cmd);').format(func.name)) print('void GLAPIENTRY _mesa_marshal_{0}({1});'.format(func.name, func.get_parameter_string())) + elif flavor == 'sync': + print('{0} GLAPIENTRY _mesa_marshal_{1}({2});'.format(func.return_type, func.name, func.get_parameter_string())) def show_usage(): -- 2.30.2