Commit db5b126d authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make sure we have an active GL context in IWineD3DSurfaceImpl_UnLoad().

parent 181442a6
......@@ -836,6 +836,7 @@ static void surface_remove_pbo(IWineD3DSurfaceImpl *This) {
static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
IWineD3DBaseTexture *texture = NULL;
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
renderbuffer_entry_t *entry, *entry2;
TRACE("(%p)\n", iface);
......@@ -866,6 +867,8 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface) {
IWineD3DSurface_ModifyLocation(iface, SFLAG_INSRGBTEX, FALSE);
This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
/* Destroy PBOs, but load them into real sysmem before */
if(This->Flags & SFLAG_PBO) {
surface_remove_pbo(This);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment