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

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

We would skip evicting the specific mapped sub-resource, but then go on to evict the texture itself. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent aca61824
......@@ -4503,6 +4503,10 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
{
TRACE("Checking resource %p for eviction.\n", resource);
/* These are handled by the texture they're part of. */
if (resource->type == WINED3D_RTYPE_SURFACE || resource->type == WINED3D_RTYPE_VOLUME)
continue;
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
{
TRACE("Evicting %p.\n", resource);
......
......@@ -1408,6 +1408,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
TRACE("Mapped front buffer %s.\n", wine_dbgstr_rect(r));
}
++resource->map_count;
++sub_resource->resource->map_count;
TRACE("Returning memory %p, row pitch %u, slice pitch %u.\n",
......@@ -1473,6 +1474,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
}
--sub_resource->resource->map_count;
--resource->map_count;
return WINED3D_OK;
}
......@@ -2263,6 +2265,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
context_release(context);
surface->flags |= SFLAG_DCINUSE;
++texture->resource.map_count;
surface->resource.map_count++;
*dc = surface->hDC;
......@@ -2302,6 +2305,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
}
surface->resource.map_count--;
--texture->resource.map_count;
surface->flags &= ~SFLAG_DCINUSE;
if (surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY
......
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