From 85276e2c1b8dfdf090a656a7fa1b5613d373515e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 20 Feb 2020 20:40:31 -0500 Subject: [PATCH] glthread: sync instead of disabling glthread for non-VBO pointers Reviewed-by: Timothy Arceri Part-of: --- src/mapi/glapi/gen/ARB_base_instance.xml | 6 +++--- .../glapi/gen/ARB_draw_elements_base_vertex.xml | 8 ++++---- src/mapi/glapi/gen/ARB_draw_indirect.xml | 8 ++++---- src/mapi/glapi/gen/ARB_draw_instanced.xml | 4 ++-- src/mapi/glapi/gen/ARB_indirect_parameters.xml | 4 ++-- src/mapi/glapi/gen/gl_API.dtd | 3 +++ src/mapi/glapi/gen/gl_API.xml | 14 +++++++------- src/mapi/glapi/gen/gl_marshal.py | 8 ++++++++ src/mapi/glapi/gen/marshal_XML.py | 1 + 9 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_base_instance.xml b/src/mapi/glapi/gen/ARB_base_instance.xml index 22c57167fd5..2846e913c06 100644 --- a/src/mapi/glapi/gen/ARB_base_instance.xml +++ b/src/mapi/glapi/gen/ARB_base_instance.xml @@ -9,7 +9,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -18,7 +18,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -28,7 +28,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml index 9f18cacd1e6..28d47839433 100644 --- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml +++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml @@ -9,7 +9,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -18,7 +18,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -29,7 +29,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -39,7 +39,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> diff --git a/src/mapi/glapi/gen/ARB_draw_indirect.xml b/src/mapi/glapi/gen/ARB_draw_indirect.xml index c17b4337baa..af342eb8683 100644 --- a/src/mapi/glapi/gen/ARB_draw_indirect.xml +++ b/src/mapi/glapi/gen/ARB_draw_indirect.xml @@ -10,14 +10,14 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays_indirect(ctx)"> + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements_indirect(ctx)"> @@ -29,7 +29,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays_indirect(ctx)"> @@ -37,7 +37,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements_indirect(ctx)"> diff --git a/src/mapi/glapi/gen/ARB_draw_instanced.xml b/src/mapi/glapi/gen/ARB_draw_instanced.xml index e450f04a8e1..bf24fc5709f 100644 --- a/src/mapi/glapi/gen/ARB_draw_instanced.xml +++ b/src/mapi/glapi/gen/ARB_draw_instanced.xml @@ -9,7 +9,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -17,7 +17,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> diff --git a/src/mapi/glapi/gen/ARB_indirect_parameters.xml b/src/mapi/glapi/gen/ARB_indirect_parameters.xml index 3938bd643bb..89d11746654 100644 --- a/src/mapi/glapi/gen/ARB_indirect_parameters.xml +++ b/src/mapi/glapi/gen/ARB_indirect_parameters.xml @@ -9,7 +9,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -19,7 +19,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd index 787fcbf2675..96d70982c83 100644 --- a/src/mapi/glapi/gen/gl_API.dtd +++ b/src/mapi/glapi/gen/gl_API.dtd @@ -41,6 +41,7 @@ desktop (true | false) "true" marshal NMTOKEN #IMPLIED marshal_fail CDATA #IMPLIED> + marshal_sync CDATA #IMPLIED> marshal_count CDATA #IMPLIED> marshal_call_after CDATA #IMPLIED> + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -3188,7 +3188,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -3756,7 +3756,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -4756,7 +4756,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -10277,7 +10277,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> @@ -11392,7 +11392,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_arrays(ctx)"> @@ -11402,7 +11402,7 @@ + marshal_sync="_mesa_glthread_is_non_vbo_draw_elements(ctx)"> diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 19deba7b3c1..3147b702c70 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -270,6 +270,14 @@ class PrintCode(gl_XML.gl_print_base): out('return;') out('}') + if func.marshal_sync: + out('if ({0}) {{'.format(func.marshal_sync)) + with indent(): + out('_mesa_glthread_finish_before(ctx, "{0}");'.format(func.name)) + self.print_sync_dispatch(func) + out('return;') + out('}') + with indent(): self.print_async_dispatch(func) out('}') diff --git a/src/mapi/glapi/gen/marshal_XML.py b/src/mapi/glapi/gen/marshal_XML.py index b673c8535d6..f0be4f8780a 100644 --- a/src/mapi/glapi/gen/marshal_XML.py +++ b/src/mapi/glapi/gen/marshal_XML.py @@ -58,6 +58,7 @@ class marshal_function(gl_XML.gl_function): # Store the "marshal" attribute, if present. self.marshal = element.get('marshal') self.marshal_fail = element.get('marshal_fail') + self.marshal_sync = element.get('marshal_sync') self.marshal_call_after = element.get('marshal_call_after') def marshal_flavor(self): -- 2.30.2