Hello.
I was recently experimenting with a fix that involved ActivateContext and needed to figure out whether it is ok if ActivateContext is called inside ENTER_GL()... LEAVE_GL() (also if recursive ENTER_GL is ok). At first I tried to look for example code in wined3d/surface.c, which seemed to indicate this is ok, because it obviously seems to happen in one or few places. Then I found this
http://bugs.winehq.org/show_bug.cgi?id=9810
from which it seems it is sort of a bug(?). Can any of 3d guys here
clarify this matter - how bad is ActivateContext between ENTER_GL/LEAVE_GL and recursive ENTER_GL, does it definitely need to be avoided and should things like this
ENTER_GL(); ... IWineD3DSurface_BindTexture(); ... LEAVE_GL();
(BindTexture does ActivateContext and ENTER_GL)
be changed to something like
ENTER_GL() ... LEAVE_GL()
IWineD3DSurface_BindTexture();
ENTER_GL() ... LEAVE_GL()
and submitted as patch if I find it?
GDI calls should be avoided within ENTER_GL/LEAVE_GL ('wine_tsx11_lock') as it can conflict with the GDI lock. (WGL calls used to be standard GDI calls, they are less sensitive to this now). ActivateContext is one of the calls which can make GDI calls and that's why it should be avoided.
A while ago I fixed most of these cases but I haven't played with the code for lets say a month or so. This piece seems to be new.
Regards, Roderick