From: Rémi Bernon rbernon@codeweavers.com
Instead of using D3D11CoreCreateDevice().
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- This supersedes patch 185304. Don't bother with D3D10CoreRegisterLayers(), just pass the d3d11 module handle.
dlls/d3d10core/Makefile.in | 2 +- dlls/d3d10core/d3d10core_main.c | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10core/Makefile.in b/dlls/d3d10core/Makefile.in index cf7efb27418..e56e38c188c 100644 --- a/dlls/d3d10core/Makefile.in +++ b/dlls/d3d10core/Makefile.in @@ -1,6 +1,6 @@ MODULE = d3d10core.dll IMPORTLIB = d3d10core -IMPORTS = d3d11 +IMPORTS = d3d11 dxgi
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index d364be90d6d..bbfa4e691af 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -22,12 +22,12 @@ #include "initguid.h"
#define COBJMACROS -#include "d3d11.h" +#include "d3d10.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
-HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, - const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, ID3D11Device **device); +HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d11, IDXGIFactory *factory, IDXGIAdapter *adapter, + unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device);
HRESULT WINAPI D3D10CoreRegisterLayers(void) { @@ -39,20 +39,27 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void) HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device) { - ID3D11Device *device11; + IUnknown *dxgi_device; + HMODULE d3d11; HRESULT hr;
TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n", factory, adapter, flags, feature_level, device);
- if (FAILED(hr = D3D11CoreCreateDevice(factory, adapter, flags, &feature_level, 1, &device11))) + d3d11 = LoadLibraryA("d3d11.dll"); + hr = DXGID3D10CreateDevice(d3d11, factory, adapter, flags, &feature_level, 1, (void **)&dxgi_device); + FreeLibrary(d3d11); + if (FAILED(hr)) + { + WARN("Failed to create device, hr %#x.\n", hr); return hr; + }
- hr = ID3D11Device_QueryInterface(device11, &IID_ID3D10Device, (void **)device); - ID3D11Device_Release(device11); + hr = IUnknown_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)device); + IUnknown_Release(dxgi_device); if (FAILED(hr)) { - ERR("Device should implement ID3D10Device, returning E_FAIL.\n"); + ERR("Failed to query ID3D10Device interface, returning E_FAIL.\n"); return E_FAIL; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=72599
Your paranoid android.
=== debiant (32 bit Chinese:China report) ===
d3d10core: d3d10core.c:4786: Test failed: Got unexpected CPrimitives count: 3.