Commit 369956a6 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Discard depth stencils on unload.

Doing so is equivalent of setting WINED3D_LOCATION_DISCARDED when creating new depth stencil surfaces. It will only happen on the implicit depth stencil. Signed-off-by: 's avatarStefan Dösinger <stefan@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 61ad9284
......@@ -1149,10 +1149,18 @@ static void surface_unload(struct wined3d_resource *resource)
* but we can't set the sysmem INDRAWABLE because when we're rendering the swapchain
* or the depth stencil into an FBO the texture or render buffer will be removed
* and all flags get lost */
surface_prepare_system_memory(surface);
memset(surface->resource.heap_memory, 0, surface->resource.size);
surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL)
{
surface_validate_location(surface, WINED3D_LOCATION_DISCARDED);
surface_invalidate_location(surface, ~WINED3D_LOCATION_DISCARDED);
}
else
{
surface_prepare_system_memory(surface);
memset(surface->resource.heap_memory, 0, surface->resource.size);
surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
}
/* We also get here when the ddraw swapchain is destroyed, for example
* for a mode switch. In this case this surface won't necessarily be
......
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