Henri Verbeet : wined3d: Don' t evict resources that are currently mapped in wined3d_device_evict_managed_resources ().

Alexandre Julliard julliard at winehq.org
Mon May 21 15:31:10 CDT 2012


Module: wine
Branch: master
Commit: 0d45d503420cbae1644cdc12697d86b3d84afbcf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0d45d503420cbae1644cdc12697d86b3d84afbcf

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon May 21 20:48:35 2012 +0200

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 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index dc0957a..a575eec 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 da631d6..3e1914d 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);
 }




More information about the wine-cvs mailing list