Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/adapter_gl.c | 1 + dlls/wined3d/adapter_vk.c | 2 +- dlls/wined3d/device.c | 4 +--- dlls/wined3d/wined3d_private.h | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index bba728e2fb5..3a6ff54eec2 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4575,6 +4575,7 @@ static void adapter_gl_uninit_3d(struct wined3d_device *device) { TRACE("device %p.\n", device);
+ wined3d_device_destroy_default_samplers(device); wined3d_cs_destroy_object(device->cs, wined3d_device_delete_opengl_contexts_cs, device); wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT); } diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 91a6b92b4aa..5667cd8d0d3 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -748,7 +748,6 @@ static void adapter_vk_uninit_3d_cs(void *object) device->shader_backend->shader_free_private(device, &context_vk->c); wined3d_device_vk_destroy_null_views(device_vk, context_vk); wined3d_device_vk_destroy_null_resources(device_vk, context_vk); - wined3d_device_destroy_default_samplers(device, &context_vk->c); }
static void adapter_vk_uninit_3d(struct wined3d_device *device) @@ -761,6 +760,7 @@ static void adapter_vk_uninit_3d(struct wined3d_device *device) device_vk = wined3d_device_vk(device); context_vk = &device_vk->context_vk;
+ wined3d_device_destroy_default_samplers(device); wined3d_cs_destroy_object(device->cs, adapter_vk_uninit_3d_cs, device_vk); wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8020f7d0844..436c4dfe854 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -572,8 +572,7 @@ void wined3d_device_create_default_samplers(struct wined3d_device *device, struc } }
-/* Context activation is done by the caller. */ -void wined3d_device_destroy_default_samplers(struct wined3d_device *device, struct wined3d_context *context) +void wined3d_device_destroy_default_samplers(struct wined3d_device *device) { wined3d_sampler_decref(device->default_sampler); device->default_sampler = NULL; @@ -982,7 +981,6 @@ void wined3d_device_delete_opengl_contexts_cs(void *object) device->blitter->ops->blitter_destroy(device->blitter, context); device->shader_backend->shader_free_private(device, context); wined3d_device_gl_destroy_dummy_textures(device_gl, context_gl); - wined3d_device_destroy_default_samplers(device, context); context_release(context);
while (device->context_count) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fe7a8dff55e..827ebbec773 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3889,8 +3889,7 @@ void wined3d_device_create_default_samplers(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void wined3d_device_create_primary_opengl_context_cs(void *object) DECLSPEC_HIDDEN; void wined3d_device_delete_opengl_contexts_cs(void *object) DECLSPEC_HIDDEN; -void wined3d_device_destroy_default_samplers(struct wined3d_device *device, - struct wined3d_context *context) DECLSPEC_HIDDEN; +void wined3d_device_destroy_default_samplers(struct wined3d_device *device) DECLSPEC_HIDDEN; HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined3d, unsigned int adapter_idx, enum wined3d_device_type device_type, HWND focus_window, unsigned int flags, BYTE surface_alignment, const enum wined3d_feature_level *levels, unsigned int level_count,