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('};')
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('{')
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('{')
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 */
"""
print(footer)
def printBody(self, api):
+ print('#include "GL/gl.h"')
+ print('')
print('enum marshal_dispatch_cmd_id')
print('{')
for func in api.functionIterateAll():
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():