From a5d308e51a7be7e90d1373fa8ec7813ae8018ae5 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sat, 7 May 2016 16:25:03 +0200 Subject: [PATCH] st/nine: Wait for pending tasks to execute in swapchain Fixes crash after Reset() when using thread_submit=true Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/swapchain9.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c index 31060632370..fcda9c7837e 100644 --- a/src/gallium/state_trackers/nine/swapchain9.c +++ b/src/gallium/state_trackers/nine/swapchain9.c @@ -243,6 +243,10 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This, desc.Width = pParams->BackBufferWidth; desc.Height = pParams->BackBufferHeight; + for (i = 0; i < oldBufferCount; i++) { + if (This->tasks[i]) + _mesa_threadpool_wait_for_task(This->pool, &(This->tasks[i])); + } memset(This->tasks, 0, sizeof(This->tasks)); if (This->pool) { -- 2.30.2