Module: wine Branch: master Commit: b54553a2537d4b44b7e6d36caa6c893b1862b9e0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b54553a2537d4b44b7e6d36caa...
Author: Alexander Dorofeyev alexd4@inbox.lv Date: Thu Apr 3 00:12:00 2008 +0300
wined3d: Avoid calling LoadTexture with gl lock held in IWineD3DSurfaceImpl_PreLoad.
Needed to prevent ActivateContext being called while holding gl lock.
---
dlls/wined3d/surface.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 28ffdcb..e7f7391 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -509,19 +509,22 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) { } glBindTexture(This->glDescription.target, This->glDescription.textureName); checkGLcall("glBindTexture"); + LEAVE_GL(); IWineD3DSurface_LoadTexture(iface, FALSE); /* This is where we should be reducing the amount of GLMemoryUsed */ } else if (This->glDescription.textureName) { /* NOTE: the level 0 surface of a mpmapped texture must be loaded first! */ /* assume this is a coding error not a real error for now */ FIXME("Mipmap surface has a glTexture bound to it!\n"); + LEAVE_GL(); } if (This->resource.pool == WINED3DPOOL_DEFAULT) { /* Tell opengl to try and keep this texture in video ram (well mostly) */ GLclampf tmp; tmp = 0.9f; + ENTER_GL(); glPrioritizeTextures(1, &This->glDescription.textureName, &tmp); + LEAVE_GL(); } - LEAVE_GL(); } return; }