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

This commit is contained in:
Henri Verbeet 2012-05-21 20:48:35 +02:00 committed by Alexandre Julliard
parent 5ec56c9bc4
commit 0d45d50342
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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);
}