[PATCH 2/5] d3dx10: Add support for ID3DX10ThreadPump parameter in D3DX10CreateTextureFromResourceA.
Piotr Caban
wine at gitlab.winehq.org
Thu Jun 16 02:40:59 CDT 2022
From: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
---
dlls/d3dx10_43/texture.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c
index 31775fd6863..7a4031727fa 100644
--- a/dlls/d3dx10_43/texture.c
+++ b/dlls/d3dx10_43/texture.c
@@ -674,11 +674,32 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceA(ID3D10Device *device, HMODULE mo
if (!device)
return E_INVALIDARG;
- hr = load_resourceA(module, resource, &buffer, &size);
- if (FAILED(hr))
+ if (pump)
+ {
+ ID3DX10DataProcessor *processor;
+ ID3DX10DataLoader *loader;
+
+ if (FAILED((hr = D3DX10CreateAsyncResourceLoaderA(module, resource, &loader))))
+ return hr;
+ if (FAILED((hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &processor))))
+ {
+ ID3DX10DataLoader_Destroy(loader);
+ return hr;
+ }
+ if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture))))
+ {
+ ID3DX10DataLoader_Destroy(loader);
+ ID3DX10DataProcessor_Destroy(processor);
+ }
return hr;
+ }
- return D3DX10CreateTextureFromMemory(device, buffer, size, load_info, pump, texture, hresult);
+ if (FAILED((hr = load_resourceA(module, resource, &buffer, &size))))
+ return hr;
+ hr = create_texture(device, buffer, size, load_info, texture);
+ if (hresult)
+ *hresult = hr;
+ return hr;
}
HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE module, const WCHAR *resource,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/257
More information about the wine-devel
mailing list