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: Stefan Dösinger <stefan@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
61ad9284d0
commit
369956a6fd
|
@ -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
|
* 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
|
* or the depth stencil into an FBO the texture or render buffer will be removed
|
||||||
* and all flags get lost */
|
* and all flags get lost */
|
||||||
surface_prepare_system_memory(surface);
|
if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL)
|
||||||
memset(surface->resource.heap_memory, 0, surface->resource.size);
|
{
|
||||||
surface_validate_location(surface, WINED3D_LOCATION_SYSMEM);
|
surface_validate_location(surface, WINED3D_LOCATION_DISCARDED);
|
||||||
surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM);
|
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
|
/* 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
|
* for a mode switch. In this case this surface won't necessarily be
|
||||||
|
|
Loading…
Reference in New Issue