From 36740aa1f1ac438a2b221ea89c50d798149f6078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 23 Dec 2020 02:42:04 -0500 Subject: [PATCH] glthread: remove marshal="draw" because it doesn't do much It only checked whether the pointer was indices or indirect, but we can just determine the same thing manually for each draw call. Simplify it as follows: - if a call contains a pointer without count and it's either indirect or indices, set marshal="async". The marshal_sync attribute still determines when it syncs. - if a call doesn't contain any pointer without count, remove the marshal attribute Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mapi/glapi/gen/ARB_draw_indirect.xml | 8 ++++---- src/mapi/glapi/gen/ARB_indirect_parameters.xml | 4 ++-- src/mapi/glapi/gen/EXT_transform_feedback.xml | 2 +- src/mapi/glapi/gen/gl_API.dtd | 4 +--- src/mapi/glapi/gen/gl_API.xml | 12 ++++++------ src/mapi/glapi/gen/marshal_XML.py | 6 ++---- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_draw_indirect.xml b/src/mapi/glapi/gen/ARB_draw_indirect.xml index 6dc1d6feeec..541647a0c38 100644 --- a/src/mapi/glapi/gen/ARB_draw_indirect.xml +++ b/src/mapi/glapi/gen/ARB_draw_indirect.xml @@ -9,14 +9,14 @@ @@ -28,7 +28,7 @@ - @@ -36,7 +36,7 @@ - diff --git a/src/mapi/glapi/gen/ARB_indirect_parameters.xml b/src/mapi/glapi/gen/ARB_indirect_parameters.xml index 2739f153875..f08201d4a22 100644 --- a/src/mapi/glapi/gen/ARB_indirect_parameters.xml +++ b/src/mapi/glapi/gen/ARB_indirect_parameters.xml @@ -8,7 +8,7 @@ - @@ -18,7 +18,7 @@ - diff --git a/src/mapi/glapi/gen/EXT_transform_feedback.xml b/src/mapi/glapi/gen/EXT_transform_feedback.xml index 604ab7cd0d5..01aa2a364ec 100644 --- a/src/mapi/glapi/gen/EXT_transform_feedback.xml +++ b/src/mapi/glapi/gen/EXT_transform_feedback.xml @@ -108,7 +108,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd index aceb69c07f6..3d1801ad2b5 100644 --- a/src/mapi/glapi/gen/gl_API.dtd +++ b/src/mapi/glapi/gen/gl_API.dtd @@ -124,14 +124,12 @@ param: offset data should be padded to the next even number of dimensions. For example, this will insert an empty "height" field after the "width" field in the protocol for TexImage1D. - marshal - One of "sync", "async", "draw", or "custom", defaulting to + marshal - One of "sync", "async", or "custom", defaulting to async unless one of the arguments is something we know we can't codegen for. If "sync", we finish any queued glthread work and call the Mesa implementation directly. If "async", we queue the function call to be performed by glthread. If "custom", the prototype will be generated but a custom implementation will be present in marshal.c. - If "draw", it will follow the "async" rules except that "indices" are - ignored (since they may come from a VBO). marshal_sync - an expression that, if it evaluates true, causes glthread to sync and execute the call directly. marshal_count - same as count, but variable_param is ignored. Used by diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index dcdbe80290c..7aab5c5d828 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -3169,7 +3169,7 @@ - + @@ -8156,7 +8156,7 @@ - + @@ -8204,13 +8204,13 @@ - + - + @@ -11409,7 +11409,7 @@ - @@ -11419,7 +11419,7 @@ - diff --git a/src/mapi/glapi/gen/marshal_XML.py b/src/mapi/glapi/gen/marshal_XML.py index 42c82c15e68..d1c0bca7938 100644 --- a/src/mapi/glapi/gen/marshal_XML.py +++ b/src/mapi/glapi/gen/marshal_XML.py @@ -65,7 +65,7 @@ class marshal_function(gl_XML.gl_function): client and server threads.""" # If a "marshal" attribute was present, that overrides any # determination that would otherwise be made by this function. - if self.marshal not in (None, 'draw'): + if self.marshal is not None: return self.marshal if self.exec_flavor == 'skip': @@ -78,9 +78,7 @@ class marshal_function(gl_XML.gl_function): for p in self.parameters: if p.is_output: return 'sync' - if (p.is_pointer() and not (p.count or p.counter or p.marshal_count) - and not (self.marshal == 'draw' - and (p.name == 'indices' or p.name == 'indirect'))): + if (p.is_pointer() and not (p.count or p.counter or p.marshal_count)): return 'sync' if p.count_parameter_list and not p.marshal_count: # Parameter size is determined by enums; haven't