mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
wined3d: Don't leave leftover textures when destroying and creating dxgi swapchains.
This commit is contained in:
parent
f98c896e8a
commit
06a8cbcc35
@ -42,7 +42,8 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
|
||||
* is the last buffer to be destroyed, FindContext() depends on that. */
|
||||
if (swapchain->front_buffer)
|
||||
{
|
||||
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL);
|
||||
if (swapchain->front_buffer->container.type == WINED3D_CONTAINER_SWAPCHAIN)
|
||||
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_NONE, NULL);
|
||||
if (wined3d_surface_decref(swapchain->front_buffer))
|
||||
WARN("Something's still holding the front buffer (%p).\n", swapchain->front_buffer);
|
||||
swapchain->front_buffer = NULL;
|
||||
@ -54,7 +55,8 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
|
||||
|
||||
while (i--)
|
||||
{
|
||||
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_NONE, NULL);
|
||||
if (swapchain->back_buffers[i]->container.type == WINED3D_CONTAINER_SWAPCHAIN)
|
||||
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_NONE, NULL);
|
||||
if (wined3d_surface_decref(swapchain->back_buffers[i]))
|
||||
WARN("Something's still holding back buffer %u (%p).\n", i, swapchain->back_buffers[i]);
|
||||
}
|
||||
@ -917,7 +919,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_
|
||||
goto err;
|
||||
}
|
||||
|
||||
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, swapchain);
|
||||
if (swapchain->front_buffer->container.type == WINED3D_CONTAINER_NONE)
|
||||
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, swapchain);
|
||||
if (surface_type == WINED3D_SURFACE_TYPE_OPENGL)
|
||||
surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE);
|
||||
|
||||
@ -1025,8 +1028,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_
|
||||
WARN("Failed to create back buffer %u, hr %#x.\n", i, hr);
|
||||
goto err;
|
||||
}
|
||||
|
||||
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, swapchain);
|
||||
if (swapchain->back_buffers[i]->container.type == WINED3D_CONTAINER_NONE)
|
||||
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, swapchain);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user