From c59fd3acb9ef7442e5219758927738ffbdcf2e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 11 Feb 2021 15:07:47 -0500 Subject: [PATCH] glthread: ignore the return value of glUnmapBuffer, don't sync, and return true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We always return GL_TRUE from the Unmap functions. gl_marshal.py is modified so as not to use "return" in the unmarshal function, which always returns void. Reviewed-by: Zoltán Böszörményi Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mapi/glapi/gen/EXT_direct_state_access.xml | 2 +- src/mapi/glapi/gen/gl_API.xml | 2 +- src/mapi/glapi/gen/gl_marshal.py | 6 ++++-- src/mapi/glapi/gen/gl_marshal_h.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 7918653d3c3..c88642f104b 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -906,7 +906,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index a4d4f837add..f0496a14285 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -5169,7 +5169,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 590e036f9f8..df43097556a 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -84,7 +84,7 @@ class PrintCode(gl_XML.gl_print_base): def print_sync_call(self, func, unmarshal = 0): call = 'CALL_{0}(ctx->CurrentServerDispatch, ({1}))'.format( func.name, func.get_called_parameter_string()) - if func.return_type == 'void': + if func.return_type == 'void' or unmarshal: out('{0};'.format(call)) if func.marshal_call_after and not unmarshal: out(func.marshal_call_after); @@ -306,7 +306,7 @@ class PrintCode(gl_XML.gl_print_base): out('}') def print_async_marshal(self, func): - out('void GLAPIENTRY') + out('{0} GLAPIENTRY'.format(func.return_type)) out('_mesa_marshal_{0}({1})'.format( func.name, func.get_parameter_string())) out('{') @@ -338,6 +338,8 @@ class PrintCode(gl_XML.gl_print_base): self.validate_count_or_fallback(func) self.print_async_dispatch(func) + if func.return_type == 'GLboolean': + out('return GL_TRUE;') # for glUnmapBuffer out('}') def print_async_body(self, func): diff --git a/src/mapi/glapi/gen/gl_marshal_h.py b/src/mapi/glapi/gen/gl_marshal_h.py index 6372e4a5602..729103b456d 100644 --- a/src/mapi/glapi/gen/gl_marshal_h.py +++ b/src/mapi/glapi/gen/gl_marshal_h.py @@ -73,7 +73,7 @@ class PrintCode(gl_XML.gl_print_base): print('struct marshal_cmd_{0};'.format(func.name)) print(('void _mesa_unmarshal_{0}(struct gl_context *ctx, ' 'const struct marshal_cmd_{0} *cmd);').format(func.name)) - print('void GLAPIENTRY _mesa_marshal_{0}({1});'.format(func.name, func.get_parameter_string())) + print('{0} GLAPIENTRY _mesa_marshal_{1}({2});'.format(func.return_type, func.name, func.get_parameter_string())) elif flavor == 'sync': print('{0} GLAPIENTRY _mesa_marshal_{1}({2});'.format(func.return_type, func.name, func.get_parameter_string()))