From 0d45d503420cbae1644cdc12697d86b3d84afbcf Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 21 May 2012 20:48:35 +0200 Subject: [PATCH] wined3d: Don't evict resources that are currently mapped in wined3d_device_evict_managed_resources(). --- dlls/wined3d/device.c | 2 +- dlls/wined3d/resource.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dc0957acf30..a575eec5a45 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5096,7 +5096,7 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) { TRACE("Checking resource %p for eviction.\n", resource); - if (resource->pool == WINED3D_POOL_MANAGED) + if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); resource->resource_ops->resource_unload(resource); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index da631d63ea3..3e1914dbeff 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -171,6 +171,9 @@ void resource_cleanup(struct wined3d_resource *resource) void resource_unload(struct wined3d_resource *resource) { + if (resource->map_count) + ERR("Resource %p is being unloaded while mapped.\n", resource); + context_resource_unloaded(resource->device, resource, resource->type); }