d3dx10: Add support for ID3DX10ThreadPump parameter in D3DX10CreateTextureFromResourceW.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
This commit is contained in:
parent
1b39e769b5
commit
798395d3b2
1 changed files with 25 additions and 4 deletions
|
@ -715,11 +715,32 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE mo
|
||||||
if (!device)
|
if (!device)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
hr = load_resourceW(module, resource, &buffer, &size);
|
if (pump)
|
||||||
if (FAILED(hr))
|
{
|
||||||
return hr;
|
ID3DX10DataProcessor *processor;
|
||||||
|
ID3DX10DataLoader *loader;
|
||||||
|
|
||||||
return D3DX10CreateTextureFromMemory(device, buffer, size, load_info, pump, texture, hresult);
|
if (FAILED((hr = D3DX10CreateAsyncResourceLoaderW(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED((hr = load_resourceW(module, resource, &buffer, &size))))
|
||||||
|
return hr;
|
||||||
|
hr = create_texture(device, buffer, size, load_info, texture);
|
||||||
|
if (hresult)
|
||||||
|
*hresult = hr;
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_INFO *out)
|
void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_INFO *out)
|
||||||
|
|
Loading…
Add table
Reference in a new issue