diff options
author | Marek Olšák <[email protected]> | 2020-02-18 22:57:28 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 01:06:13 +0000 |
commit | d93f4faefb0a867ea33b9530e9aa67ae1ed60e93 (patch) | |
tree | fb31d9498521aa02c1fe240bf0eac0381a7c24a1 /src | |
parent | a19c9290f44e6e73a104067a98420c273d98721b (diff) |
glthread: don't generate the sync fallback if the call size is not variable
marshal_generated.c is 12% smaller.
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/gl_marshal.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 4fd2bc2a5b9..a994a1425bc 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -254,19 +254,23 @@ class PrintCode(gl_XML.gl_print_base): out('return;') out('}') - out('if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {') + if len(func.variable_params) > 0: + with indent(): + out('if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {') + with indent(): + self.print_async_dispatch(func) + out('return;') + out('}') + out('') + if need_fallback_sync: + out('fallback_to_sync:') + with indent(): + out('_mesa_glthread_finish(ctx);') + self.print_sync_dispatch(func) + else: with indent(): self.print_async_dispatch(func) - out('return;') - out('}') - - out('') - if need_fallback_sync: - out('fallback_to_sync:') - with indent(): - out('_mesa_glthread_finish(ctx);') - self.print_sync_dispatch(func) - + assert not need_fallback_sync out('}') def print_async_body(self, func): |