From cb6de00c86fd958aeab624088325ca7a1bd32002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 5 Feb 2008 21:56:46 +0100 Subject: [PATCH] wined3d: Tear down the dummy textures before resetting. In theory the opengl library should release the gl resources when we destroy the context, and the stateblock reset will recreate the dummy textures, but I think it is cleaner to do this explicitly. --- dlls/wined3d/device.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7b924da06e0..10d11b8dac6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6777,6 +6777,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE WINED3DDISPLAYMODE mode; IWineD3DBaseShaderImpl *shader; IWineD3DSurfaceImpl *target; + UINT i; TRACE("(%p)\n", This); hr = IWineD3DDevice_GetSwapChain(iface, 0, (IWineD3DSwapChain **) &swapchain); @@ -6839,14 +6840,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE This->shader_backend->shader_destroy((IWineD3DBaseShader *) shader); } + ENTER_GL(); if(This->depth_blt_texture) { - ENTER_GL(); glDeleteTextures(1, &This->depth_blt_texture); - LEAVE_GL(); This->depth_blt_texture = 0; } This->shader_backend->shader_destroy_depth_blt(iface); + for (i = 0; i < GL_LIMITS(textures); i++) { + /* The stateblock initialization below will recreate them */ + glDeleteTextures(1, &This->dummyTextureName[i]); + checkGLcall("glDeleteTextures(1, &This->dummyTextureName[i])"); + This->dummyTextureName[i] = 0; + } + LEAVE_GL(); + while(This->numContexts) { DestroyContext(This, This->contexts[0]); }