summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen/gl_marshal.py
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-02-28 18:15:58 -0800
committerTimothy Arceri <[email protected]>2017-03-16 14:14:19 +1100
commitcd1c003b18353c220b1b81dcecc9cab2996ce608 (patch)
tree1e8adf2fc9a5e9d676316cb5a852cd5b262d8574 /src/mapi/glapi/gen/gl_marshal.py
parent43d4f7a227eaa01ea4be32e598682abc912e8e83 (diff)
mesa: Add an attribute for conditions to turn off threading.
The threading for GL core is in place, but there are so few applications actually using a core GL context that it would be nice to extend support back. However, some of the features of compat GL (particularly user vertex arrays) would be so expensive to track state for that we want to be able to disable threading when we discover that the app is using them. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen/gl_marshal.py')
-rw-r--r--src/mapi/glapi/gen/gl_marshal.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index 1a633435001..a50d773e27e 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -236,6 +236,14 @@ class PrintCode(gl_XML.gl_print_base):
self.validate_count_or_return(func)
+ if func.marshal_fail:
+ out('if ({0}) {{'.format(func.marshal_fail))
+ with indent():
+ out('_mesa_glthread_destroy(ctx);')
+ self.print_sync_dispatch(func)
+ out('return;')
+ out('}')
+
out('if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {')
with indent():
self.print_async_dispatch(func)