diff --git a/src/mapi/glapi/gen/gl_unmarshal_table.py b/src/mapi/glapi/gen/gl_unmarshal_table.py index 06003a9bf6b..1cd04a6d834 100644 --- a/src/mapi/glapi/gen/gl_unmarshal_table.py +++ b/src/mapi/glapi/gen/gl_unmarshal_table.py @@ -65,12 +65,21 @@ class PrintCode(gl_XML.gl_print_base): out('const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD] = {') with indent(): for func in api.functionIterateAll(): - flavor = func.marshal_flavor() - if flavor in ('skip', 'sync'): + if func.marshal_flavor() in ('skip', 'sync'): continue out('[DISPATCH_CMD_{0}] = (_mesa_unmarshal_func)_mesa_unmarshal_{0},'.format(func.name)) out('};') + # Print the string table of function names. + out('') + out('const char *_mesa_unmarshal_func_name[NUM_DISPATCH_CMD] = {') + with indent(): + for func in api.functionIterateAll(): + if func.marshal_flavor() in ('skip', 'sync'): + continue + out('[DISPATCH_CMD_{0}] = "{0}",'.format(func.name)) + out('};') + def show_usage(): print('Usage: %s [file_name]' % sys.argv[0]) diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 3560754d39d..95f846548bb 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -54,6 +54,7 @@ struct marshal_cmd_base typedef uint32_t (*_mesa_unmarshal_func)(struct gl_context *ctx, const void *restrict cmd); extern const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD]; +extern const char *_mesa_unmarshal_func_name[NUM_DISPATCH_CMD]; struct marshal_cmd_DrawElementsUserBuf {