diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b022755ecde..2b4a4611342 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -7786,23 +7786,21 @@ static void IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3DResour list_add_head(&This->resources, &((IWineD3DResourceImpl *) resource)->resource.resource_list_entry); } -static void IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWineD3DResource *resource){ - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - +static void device_resource_remove(IWineD3DDeviceImpl *This, IWineD3DResource *resource) +{ TRACE("(%p) : Removing resource %p\n", This, resource); list_remove(&((IWineD3DResourceImpl *) resource)->resource.resource_list_entry); } - -static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IWineD3DResource *resource){ - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; +void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resource) +{ WINED3DRESOURCETYPE type = IWineD3DResource_GetType(resource); int counter; TRACE("(%p) : resource %p\n", This, resource); - context_resource_released(iface, resource, type); + context_resource_released((IWineD3DDevice *)This, resource, type); switch (type) { /* TODO: check front and back buffers, rendertargets etc.. possibly swapchains? */ @@ -7917,7 +7915,7 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW /* Remove the resource from the resourceStore */ - IWineD3DDeviceImpl_RemoveResource(iface, resource); + device_resource_remove(This, resource); TRACE("Resource released\n"); @@ -8089,7 +8087,6 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl = IWineD3DDeviceImpl_UpdateSurface, IWineD3DDeviceImpl_GetFrontBufferData, /*** object tracking ***/ - IWineD3DDeviceImpl_ResourceReleased, IWineD3DDeviceImpl_EnumResources }; diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 807240bb333..658a735593e 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -96,10 +96,7 @@ void resource_cleanup(IWineD3DResource *iface) This->resource.allocatedMemory = 0; This->resource.heapMemory = 0; - if (This->resource.wineD3DDevice != NULL) { - IWineD3DDevice_ResourceReleased((IWineD3DDevice *)This->resource.wineD3DDevice, iface); - }/* NOTE: this is not really an error for system memory resources */ - return; + if (This->resource.wineD3DDevice) device_resource_released(This->resource.wineD3DDevice, iface); } HRESULT resource_get_device(IWineD3DResource *iface, IWineD3DDevice** ppDevice) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index cac748c7c69..f062c97f5ab 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1578,6 +1578,7 @@ struct IWineD3DDeviceImpl extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl; +void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resource); void device_stream_info_from_declaration(IWineD3DDeviceImpl *This, BOOL use_vshader, struct wined3d_stream_info *stream_info, BOOL *fixup); void device_stream_info_from_strided(IWineD3DDeviceImpl *This, diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 48938cba2e6..51d886c85c6 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -3468,9 +3468,6 @@ interface IWineD3DDevice : IWineD3DBase [in] UINT swapchain_idx, [in] IWineD3DSurface *dst_surface ); - void ResourceReleased( - [in] IWineD3DResource *resource - ); HRESULT EnumResources( [in] D3DCB_ENUMRESOURCES callback, [in] void *data