mesa/glthread: restore the dispatch table when incompatible gl calls are detected
[mesa.git] / src / mapi / glapi / gen / gl_marshal.py
index 3b9868f9a1f5e0b746bfde4e3c24ce55577362f4..d73f08b66848988373030d86a4a3ef500e8d98dd 100644 (file)
@@ -236,6 +236,15 @@ class PrintCode(gl_XML.gl_print_base):
 
             self.validate_count_or_return(func)
 
+            if func.marshal_fail:
+                out('if ({0}) {{'.format(func.marshal_fail))
+                with indent():
+                    out('_mesa_glthread_finish(ctx);')
+                    out('_mesa_glthread_restore_dispatch(ctx);')
+                    self.print_sync_dispatch(func)
+                    out('return;')
+                out('}')
+
             out('if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {')
             with indent():
                 self.print_async_dispatch(func)