glthread: ignore the return value of glUnmapBuffer, don't sync, and return true

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 <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
This commit is contained in:
Marek Olšák 2021-02-11 15:07:47 -05:00
parent 638a184849
commit c59fd3acb9
4 changed files with 7 additions and 5 deletions

View file

@ -906,7 +906,7 @@
<param name="access" type="GLenum" />
</function>
<function name="UnmapNamedBufferEXT">
<function name="UnmapNamedBufferEXT" marshal="async">
<return type="GLboolean" />
<param name="buffer" type="GLuint" />
</function>

View file

@ -5169,7 +5169,7 @@
<glx ignore="true"/>
</function>
<function name="UnmapBuffer" es2="3.0" no_error="true">
<function name="UnmapBuffer" es2="3.0" no_error="true" marshal="async">
<param name="target" type="GLenum"/>
<return type="GLboolean"/>
<glx ignore="true"/>

View file

@ -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):

View file

@ -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()))