summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/swapchain9.c
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2016-02-22 19:49:19 +0100
committerAxel Davy <[email protected]>2016-05-18 23:37:14 +0200
commitf3fa7e3068512dde55c3f4d7c2b599ab1d7fe67f (patch)
tree5e7e193c71d70bd2f86b38cc7e82cbbaddff7c78 /src/gallium/state_trackers/nine/swapchain9.c
parent72be473ad17893ecc4697644e88defa38b35f126 (diff)
st/nine: Use WINE thread for threadpool
Use present interface 1.2 function ID3DPresent_CreateThread to create the thread for threadpool. Creating the thread with WINE prevents some rarely occuring crashes. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/swapchain9.c')
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index db3766063a5..12cad73d722 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -241,12 +241,12 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
desc.Height = pParams->BackBufferHeight;
if (This->pool) {
- _mesa_threadpool_destroy(This->pool);
+ _mesa_threadpool_destroy(This, This->pool);
This->pool = NULL;
}
This->enable_threadpool = This->actx->thread_submit && (pParams->SwapEffect != D3DSWAPEFFECT_COPY);
if (This->enable_threadpool)
- This->pool = _mesa_threadpool_create();
+ This->pool = _mesa_threadpool_create(This);
if (!This->pool)
This->enable_threadpool = FALSE;
@@ -504,7 +504,7 @@ NineSwapChain9_dtor( struct NineSwapChain9 *This )
DBG("This=%p\n", This);
if (This->pool)
- _mesa_threadpool_destroy(This->pool);
+ _mesa_threadpool_destroy(This, This->pool);
if (This->buffers) {
for (i = 0; i < This->params.BackBufferCount; i++) {
@@ -1028,3 +1028,24 @@ NineSwapChain9_ResolutionMismatch( struct NineSwapChain9 *This )
return FALSE;
}
+
+HANDLE
+NineSwapChain9_CreateThread( struct NineSwapChain9 *This,
+ void *pFuncAddress,
+ void *pParam )
+{
+ if (This->base.device->minor_version_num > 1) {
+ return ID3DPresent_CreateThread(This->present, pFuncAddress, pParam);
+ }
+
+ return NULL;
+}
+
+void
+NineSwapChain9_WaitForThread( struct NineSwapChain9 *This,
+ HANDLE thread )
+{
+ if (This->base.device->minor_version_num > 1) {
+ (void) ID3DPresent_WaitForThread(This->present, thread);
+ }
+}