From 1b306c25e22c5de24342294b453f795fbeb64a4e Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 26 Jun 2009 10:07:10 +0200 Subject: [PATCH] wined3d: Make sure we have an active GL context before calling surface_remove_pbo(). --- dlls/wined3d/surface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 37cd88a75a9..e3070d2f46e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4826,6 +4826,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D * but it isn't set (yet) in all cases it is getting called. */ if((convert != NO_CONVERSION) && (This->Flags & SFLAG_PBO)) { TRACE("Removing the pbo attached to surface %p\n", This); + if (!device->isInDraw) ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); surface_remove_pbo(This); }