Commit a5a1bcbd authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

d3d10core: Directly call DXGID3D10CreateDevice().

Instead of using D3D11CoreCreateDevice(). Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 35b23262
MODULE = d3d10core.dll MODULE = d3d10core.dll
IMPORTLIB = d3d10core IMPORTLIB = d3d10core
IMPORTS = d3d11 IMPORTS = d3d11 dxgi
EXTRADLLFLAGS = -mno-cygwin EXTRADLLFLAGS = -mno-cygwin
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
#include "initguid.h" #include "initguid.h"
#define COBJMACROS #define COBJMACROS
#include "d3d11.h" #include "d3d10.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d10core); WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d11, IDXGIFactory *factory, IDXGIAdapter *adapter,
const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, ID3D11Device **device); unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device);
HRESULT WINAPI D3D10CoreRegisterLayers(void) HRESULT WINAPI D3D10CoreRegisterLayers(void)
{ {
...@@ -39,20 +39,27 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void) ...@@ -39,20 +39,27 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void)
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device) unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device)
{ {
ID3D11Device *device11; IUnknown *dxgi_device;
HMODULE d3d11;
HRESULT hr; HRESULT hr;
TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n", TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n",
factory, adapter, flags, feature_level, device); 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; return hr;
}
hr = ID3D11Device_QueryInterface(device11, &IID_ID3D10Device, (void **)device); hr = IUnknown_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)device);
ID3D11Device_Release(device11); IUnknown_Release(dxgi_device);
if (FAILED(hr)) 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; return E_FAIL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment