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

wined3d: Unload resources in wined3d_device_uninit_3d().

Instead of in wined3d_device_delete_opengl_contexts_cs(), which is specific to the GL backend. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ca0c3f77
......@@ -939,7 +939,6 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
void wined3d_device_delete_opengl_contexts_cs(void *object)
{
struct wined3d_resource *resource, *cursor;
struct wined3d_swapchain_gl *swapchain_gl;
struct wined3d_device *device = object;
struct wined3d_context_gl *context_gl;
......@@ -949,12 +948,6 @@ void wined3d_device_delete_opengl_contexts_cs(void *object)
device_gl = wined3d_device_gl(device);
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Unloading resource %p.\n", resource);
wined3d_cs_emit_unload_resource(device->cs, resource);
}
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
{
device->shader_backend->shader_destroy(shader);
......@@ -1106,6 +1099,7 @@ static void device_free_sampler(struct wine_rb_entry *entry, void *context)
void wined3d_device_uninit_3d(struct wined3d_device *device)
{
BOOL no3d = device->wined3d->flags & WINED3D_NO3D;
struct wined3d_resource *resource, *cursor;
struct wined3d_rendertarget_view *view;
struct wined3d_texture *texture;
unsigned int i;
......@@ -1145,6 +1139,12 @@ void wined3d_device_uninit_3d(struct wined3d_device *device)
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Unloading resource %p.\n", resource);
wined3d_cs_emit_unload_resource(device->cs, resource);
}
device->adapter->adapter_ops->adapter_uninit_3d(device);
device->d3d_initialized = FALSE;
......@@ -5298,6 +5298,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(&device->state);
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Unloading resource %p.\n", resource);
wined3d_cs_emit_unload_resource(device->cs, resource);
}
if (device->d3d_initialized)
device->adapter->adapter_ops->adapter_uninit_3d(device);
......
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