[PATCH v2 2/4] dxgi: Implement IDXGIFactory6.
Philip Rebohle
philip.rebohle at tu-dortmund.de
Wed May 13 06:06:39 CDT 2020
Required by the D3D12 game "Delores: A Thimbleweed Park Mini-Adventure".
Signed-off-by: Philip Rebohle <philip.rebohle at tu-dortmund.de>
---
dlls/dxgi/factory.c | 20 ++++++++++++++++++++
include/wine/winedxgi.idl | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index 39c9e10f7a4..ab2cf755d8b 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -36,6 +36,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IWineDXGIFactory *i
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IWineDXGIFactory)
+ || IsEqualGUID(iid, &IID_IDXGIFactory6)
|| IsEqualGUID(iid, &IID_IDXGIFactory5)
|| IsEqualGUID(iid, &IID_IDXGIFactory4)
|| IsEqualGUID(iid, &IID_IDXGIFactory3)
@@ -462,6 +463,23 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CheckFeatureSupport(IWineDXGIFacto
}
}
+static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapterByGpuPreference(IWineDXGIFactory *iface,
+ UINT adapter_idx, DXGI_GPU_PREFERENCE gpu_preference, REFIID iid, void **adapter)
+{
+ IDXGIAdapter1 *adapter_object;
+ HRESULT hr;
+
+ if (gpu_preference != DXGI_GPU_PREFERENCE_UNSPECIFIED)
+ FIXME("Ignoring GPU preference %#x.\n", gpu_preference);
+
+ if (FAILED(hr = dxgi_factory_EnumAdapters1(iface, adapter_idx, &adapter_object)))
+ return hr;
+
+ hr = IDXGIAdapter1_QueryInterface(adapter_object, iid, adapter);
+ IDXGIAdapter1_Release(adapter_object);
+ return hr;
+}
+
static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl =
{
dxgi_factory_QueryInterface,
@@ -498,6 +516,8 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl =
dxgi_factory_EnumWarpAdapter,
/* IDXIGFactory5 methods */
dxgi_factory_CheckFeatureSupport,
+ /* IDXGIFactory6 methods */
+ dxgi_factory_EnumAdapterByGpuPreference,
};
struct dxgi_factory *unsafe_impl_from_IDXGIFactory(IDXGIFactory *iface)
diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl
index 070ac2fddaa..95c99b25355 100644
--- a/include/wine/winedxgi.idl
+++ b/include/wine/winedxgi.idl
@@ -89,6 +89,6 @@ interface IWineDXGIAdapter : IDXGIAdapter4
local,
uuid(ea02a0d1-4c95-488a-a82c-6034621e8c4f)
]
-interface IWineDXGIFactory : IDXGIFactory5
+interface IWineDXGIFactory : IDXGIFactory6
{
}
--
2.26.2
More information about the wine-devel
mailing list