Module: wine Branch: master Commit: cf4de1c498ae0b1a3b1a4ad233e307595797286f URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf4de1c498ae0b1a3b1a4ad233...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Feb 28 06:12:02 2017 +0100
wined3d: Send swapchain context destruction through the command stream.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/swapchain.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 3a3fc6d..1f31352 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -27,6 +27,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(fps);
+static void wined3d_swapchain_destroy_object(void *object) +{ + swapchain_destroy_contexts(object); +} + static void swapchain_cleanup(struct wined3d_swapchain *swapchain) { HRESULT hr; @@ -60,11 +65,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain) swapchain->back_buffers = NULL; }
- for (i = 0; i < swapchain->num_contexts; ++i) - { - context_destroy(swapchain->device, swapchain->context[i]); - } - HeapFree(GetProcessHeap(), 0, swapchain->context); + wined3d_cs_destroy_object(swapchain->device->cs, wined3d_swapchain_destroy_object, swapchain);
/* Restore the screen resolution if we rendered in fullscreen. * This will restore the screen resolution to what it was before creating @@ -925,7 +926,6 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 hr = E_OUTOFMEMORY; goto err; } - swapchain->num_contexts = 1;
/* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate. * You are able to add a depth + stencil surface at a later stage when you need it. @@ -953,6 +953,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 hr = WINED3DERR_NOTAVAILABLE; goto err; } + swapchain->num_contexts = 1;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && (!desc->enable_auto_depth_stencil @@ -1051,15 +1052,7 @@ err: HeapFree(GetProcessHeap(), 0, swapchain->back_buffers); }
- if (swapchain->context) - { - if (swapchain->context[0]) - { - context_destroy(device, swapchain->context[0]); - swapchain->num_contexts = 0; - } - HeapFree(GetProcessHeap(), 0, swapchain->context); - } + wined3d_cs_destroy_object(swapchain->device->cs, wined3d_swapchain_destroy_object, swapchain);
if (swapchain->front_buffer) {