dxgi: Partially implement dxgi_adapter_CheckInterfaceSupport().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2015-10-13 09:44:32 +02:00 committed by Alexandre Julliard
parent 1275375ef8
commit 895c5f8234
4 changed files with 61 additions and 12 deletions

View file

@ -200,9 +200,39 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IDXGIAdapter1 *iface, DXGI
static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter1 *iface,
REFGUID guid, LARGE_INTEGER *umd_version)
{
FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version);
struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
struct wined3d_adapter_identifier adapter_id;
HRESULT hr;
return E_NOTIMPL;
TRACE("iface %p, guid %s, umd_version %p.\n", iface, debugstr_guid(guid), umd_version);
/* This method works only for D3D10 interfaces. */
if (!(IsEqualGUID(guid, &IID_ID3D10Device)
|| IsEqualGUID(guid, &IID_ID3D10Device1)))
{
WARN("Returning DXGI_ERROR_UNSUPPORTED for %s.\n", debugstr_guid(guid));
return DXGI_ERROR_UNSUPPORTED;
}
if (FAILED(hr = dxgi_check_d3d10_support(adapter->parent, adapter)))
return DXGI_ERROR_UNSUPPORTED;
if (umd_version)
{
adapter_id.driver_size = 0;
adapter_id.description_size = 0;
adapter_id.device_name_size = 0;
wined3d_mutex_lock();
hr = wined3d_get_adapter_identifier(adapter->parent->wined3d, adapter->ordinal, 0, &adapter_id);
wined3d_mutex_unlock();
if (FAILED(hr))
return hr;
*umd_version = adapter_id.driver_version;
}
return S_OK;
}
static const struct IDXGIAdapter1Vtbl dxgi_adapter_vtbl =

View file

@ -23,7 +23,6 @@
#include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
static inline struct dxgi_device *impl_from_IWineDXGIDevice(IWineDXGIDevice *iface)
{
@ -352,7 +351,6 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
struct dxgi_factory *dxgi_factory;
void *layer_base;
HRESULT hr;
WINED3DCAPS caps;
if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory1((IDXGIFactory1 *)factory)))
{
@ -394,20 +392,16 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
IWineDXGIDeviceParent_Release(dxgi_device_parent);
FIXME("Ignoring adapter type.\n");
hr = wined3d_get_device_caps(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, &caps);
if (FAILED(hr) || caps.VertexShaderVersion < 4 || caps.PixelShaderVersion < 4)
if (FAILED(hr = dxgi_check_d3d10_support(dxgi_factory, dxgi_adapter)))
{
FIXME_(winediag)("Direct3D 10 is not supported on this GPU with the current shader backend.\n");
if (SUCCEEDED(hr))
hr = E_FAIL;
IUnknown_Release(device->child_layer);
wined3d_private_store_cleanup(&device->private_store);
wined3d_mutex_unlock();
return hr;
}
FIXME("Ignoring adapter type.\n");
hr = wined3d_device_create(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL,
NULL, 0, 4, wined3d_device_parent, &device->wined3d_device);
if (FAILED(hr))

View file

@ -30,7 +30,7 @@
#include "objbase.h"
#include "winnls.h"
#include "dxgi.h"
#include "d3d10_1.h"
#ifdef DXGI_INIT_GUID
#include "initguid.h"
#endif
@ -168,4 +168,6 @@ struct dxgi_surface
HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
IUnknown *outer, struct wined3d_resource *wined3d_resource) DECLSPEC_HIDDEN;
HRESULT dxgi_check_d3d10_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
#endif /* __WINE_DXGI_PRIVATE_H */

View file

@ -23,6 +23,7 @@
#include "dxgi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
#define WINE_DXGI_TO_STR(x) case x: return #x
@ -432,3 +433,25 @@ HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
return hr;
}
HRESULT dxgi_check_d3d10_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter)
{
WINED3DCAPS caps;
HRESULT hr;
FIXME("Ignoring adapter type.\n");
wined3d_mutex_lock();
hr = wined3d_get_device_caps(factory->wined3d, adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, &caps);
if (FAILED(hr) || caps.VertexShaderVersion < 4 || caps.PixelShaderVersion < 4)
{
FIXME_(winediag)("Direct3D 10 is not supported on this GPU with the current shader backend.\n");
if (SUCCEEDED(hr))
hr = E_FAIL;
wined3d_mutex_unlock();
return hr;
}
wined3d_mutex_unlock();
return S_OK;
}