glthread: add a string table of function names

for printing glthread batches

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
This commit is contained in:
Marek Olšák
2023-12-01 02:25:21 -05:00
committed by Marge Bot
parent adfab9794e
commit 64b769a102
2 changed files with 12 additions and 2 deletions
+11 -2
View File
@@ -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])
+1
View File
@@ -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
{