Made ENTER_GL() - LEAVE_GL() free X11 lock on exception inside opengl, code

Chris Robinson chris.kcat at
Sat Jun 28 13:36:26 CDT 2008

On Saturday 28 June 2008 07:51:53 am Massimo Del Fedele wrote:
> Roderick Colenbrander ha scritto:
> > Hi,
> >
> > I don't think we want to go this way. First of all we want to emulate
> > win32 opengl. If windows does this we MIGHT have to do something like
> > this.
> Well, I've never seen windows hang for an opengl call exception... But I
>    can be wrong. IMHO the exception should be catched and/or propagated,
> not allowed to block the whole app.....
> Here the problem is that an exception thrown by gl code skips the
> wine_tsx11_unlock() call, blocking all following X11 code.

I think the issue is that it shouldn't be crashing. Especially if we don't 
know why it's crashing, this patch is just hiding the error more than 
anything. For all we know it can be a buffer overrun somewhere, and you don't 
want to just work around things like that.

> > Second all opengl calls hit ENTER_GL / LEAVE_GL and these few extra calls
> > affect performance. 
> which extra calls ?

The __TRY stuff. It's rather expensive to set up an exception block, even in 
C++ where it's part of the language (let alone how Wine does it in C). But we 
do know D3D doesn't catch exceptions in most cases (it can crash in plenty of 
ways), so I don't think this is correct anyway.

More information about the wine-devel mailing list