Piotr Caban : d3dx10: Add ID3DX10ThreadPump:ProcessDeviceWorkItems implementation.
Alexandre Julliard
julliard at winehq.org
Mon Jul 4 16:42:26 CDT 2022
Module: wine
Branch: master
Commit: 0522fcd4a08195780032d612c255651877dff71d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0522fcd4a08195780032d612c255651877dff71d
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Jun 14 20:40:55 2022 +0200
d3dx10: Add ID3DX10ThreadPump:ProcessDeviceWorkItems implementation.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
dlls/d3dx10_43/async.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/async.c b/dlls/d3dx10_43/async.c
index 2eb27d0f535..5aaaabc041f 100644
--- a/dlls/d3dx10_43/async.c
+++ b/dlls/d3dx10_43/async.c
@@ -790,8 +790,34 @@ static HRESULT WINAPI thread_pump_WaitForAllItems(ID3DX10ThreadPump *iface)
static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems(ID3DX10ThreadPump *iface, UINT count)
{
- FIXME("iface %p, count %u stub!\n", iface, count);
- return E_NOTIMPL;
+ struct thread_pump *thread_pump = impl_from_ID3DX10ThreadPump(iface);
+ struct work_item *work_item;
+ HRESULT hr;
+ UINT i;
+
+ TRACE("iface %p, count %u.\n", iface, count);
+
+ for (i = 0; i < count; ++i)
+ {
+ AcquireSRWLockExclusive(&thread_pump->device_lock);
+ if (!thread_pump->device_count)
+ {
+ ReleaseSRWLockExclusive(&thread_pump->device_lock);
+ break;
+ }
+
+ --thread_pump->device_count;
+ work_item = LIST_ENTRY(list_head(&thread_pump->device_queue), struct work_item, entry);
+ list_remove(&work_item->entry);
+ ReleaseSRWLockExclusive(&thread_pump->device_lock);
+
+ hr = ID3DX10DataProcessor_CreateDeviceObject(work_item->processor, work_item->object);
+ if (work_item->result)
+ *work_item->result = hr;
+ work_item_free(work_item, FALSE);
+ }
+
+ return S_OK;
}
static HRESULT WINAPI thread_pump_PurgeAllItems(ID3DX10ThreadPump *iface)
More information about the wine-cvs
mailing list