Module: Mesa
Branch: master
Commit: c59fd3acb9ef7442e5219758927738ffbdcf2e71
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c59fd3acb9ef7442e5219758927738ffbdcf2e71

Author: Marek Olšák <[email protected]>
Date:   Thu Feb 11 15:07:47 2021 -0500

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 <[email protected]>
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>

---

 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 @@
       <param name="access" type="GLenum" />
    </function>
 
-   <function name="UnmapNamedBufferEXT">
+   <function name="UnmapNamedBufferEXT" marshal="async">
       <return type="GLboolean" />
       <param name="buffer" type="GLuint" />
    </function>
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 @@
         <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"/>
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()))
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to