Declare them in the header file. Then we can split marshal_generated.c
into multiple files.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270>
def print_sync_body(self, func):
out('/* {0}: marshalled synchronously */'.format(func.name))
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():
out('_mesa_marshal_{0}({1})'.format(func.name, func.get_parameter_string()))
out('{')
with indent():
out('};')
def print_async_unmarshal(self, func):
out('};')
def print_async_unmarshal(self, func):
out(('_mesa_unmarshal_{0}(struct gl_context *ctx, '
'const struct marshal_cmd_{0} *cmd)').format(func.name))
out('{')
out(('_mesa_unmarshal_{0}(struct gl_context *ctx, '
'const struct marshal_cmd_{0} *cmd)').format(func.name))
out('{')
out('}')
def print_async_marshal(self, func):
out('}')
def print_async_marshal(self, func):
- out('static void GLAPIENTRY')
out('_mesa_marshal_{0}({1})'.format(
func.name, func.get_parameter_string()))
out('{')
out('_mesa_marshal_{0}({1})'.format(
func.name, func.get_parameter_string()))
out('{')
-#ifndef MARSHAL_GENERATABLE_H
-#define MARSHAL_GENERATABLE_H
+#ifndef MARSHAL_GENERATED_H
+#define MARSHAL_GENERATED_H
-#endif /* MARSHAL_GENERATABLE_H */
+#endif /* MARSHAL_GENERATED_H */
print(footer)
def printBody(self, api):
print(footer)
def printBody(self, api):
+ print('#include "GL/gl.h"')
+ print('')
print('enum marshal_dispatch_cmd_id')
print('{')
for func in api.functionIterateAll():
print('enum marshal_dispatch_cmd_id')
print('{')
for func in api.functionIterateAll():
for func in api.functionIterateAll():
flavor = func.marshal_flavor()
for func in api.functionIterateAll():
flavor = func.marshal_flavor()
+ 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()))
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()))