From b54553a2537d4b44b7e6d36caa6c893b1862b9e0 Mon Sep 17 00:00:00 2001 From: Alexander Dorofeyev Date: Thu, 3 Apr 2008 00:12:00 +0300 Subject: [PATCH] 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 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 28ffdcbc7ee..e7f73918e59 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; } -- 2.11.4.GIT