Signed-off-by: Philip Rebohle philip.rebohle@tu-dortmund.de --- include/dxgi1_6.idl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/include/dxgi1_6.idl b/include/dxgi1_6.idl index 9dcf9f26b46..9f6d947da28 100644 --- a/include/dxgi1_6.idl +++ b/include/dxgi1_6.idl @@ -34,6 +34,13 @@ typedef enum DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED = 0x4, } DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS;
+typedef enum DXGI_GPU_PREFERENCE +{ + DXGI_GPU_PREFERENCE_UNSPECIFIED = 0, + DXGI_GPU_PREFERENCE_MINIMUM_POWER = 1, + DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE = 2, +} DXGI_GPU_PREFERENCE; + typedef struct DXGI_ADAPTER_DESC3 { WCHAR Description[128]; @@ -96,3 +103,36 @@ interface IDXGIOutput6 : IDXGIOutput5 [out] UINT *flags ); } + +[ + object, + uuid(c1b6694f-ff09-44a9-b03c-77900a0a1d17), + local, + pointer_default(unique) +] +interface IDXGIFactory6 : IDXGIFactory5 +{ + HRESULT EnumAdapterByGpuPreference( + [in] UINT adapter_idx, + [in] DXGI_GPU_PREFERENCE gpu_preference, + [in] REFIID iid, + [out] void** idx + ); +} + +[ + object, + uuid(a4966eed-76db-44da-84c1-ee9a7afb20a8), + local, + pointer_default(unique) +] +interface IDXGIFactory7 : IDXGIFactory6 +{ + HRESULT RegisterAdaptersChangedEvent( + [in] HANDLE event, + [out] DWORD *cookie + ); + HRESULT UnregisterAdaptersChangedEvent( + [in] DWORD cookie + ); +}
The D3D12 game "Delores: A Thimbleweed Park Mini-Adventure" requires at least IDXGIFactory6 to be supported.
Signed-off-by: Philip Rebohle philip.rebohle@tu-dortmund.de --- dlls/dxgi/factory.c | 40 +++++++++++++++++++++++++++++++++++++++ include/wine/winedxgi.idl | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 39c9e10f7a4..25370e818b9 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -36,6 +36,8 @@ 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_IDXGIFactory7) + || IsEqualGUID(iid, &IID_IDXGIFactory6) || IsEqualGUID(iid, &IID_IDXGIFactory5) || IsEqualGUID(iid, &IID_IDXGIFactory4) || IsEqualGUID(iid, &IID_IDXGIFactory3) @@ -462,6 +464,39 @@ 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 HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterAdaptersChangedEvent(IWineDXGIFactory *iface, + HANDLE event, DWORD *cookie) +{ + FIXME("iface %p, event %p, cookie %p stub!\n", iface, event, cookie); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dxgi_factory_UnregisterAdaptersChangedEvent(IWineDXGIFactory *iface, + DWORD cookie) +{ + FIXME("iface %p, cookie %#x stub!\n", iface, cookie); + + return E_NOTIMPL; +} + static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = { dxgi_factory_QueryInterface, @@ -498,6 +533,11 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = dxgi_factory_EnumWarpAdapter, /* IDXIGFactory5 methods */ dxgi_factory_CheckFeatureSupport, + /* IDXIGFactory6 methods */ + dxgi_factory_EnumAdapterByGpuPreference, + /* IDXIGFactory7 methods */ + dxgi_factory_RegisterAdaptersChangedEvent, + dxgi_factory_UnregisterAdaptersChangedEvent, };
struct dxgi_factory *unsafe_impl_from_IDXGIFactory(IDXGIFactory *iface) diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl index 070ac2fddaa..83012047ea7 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 : IDXGIFactory7 { }
On 5/13/20 8:08 AM, Philip Rebohle wrote:
The D3D12 game "Delores: A Thimbleweed Park Mini-Adventure" requires at least IDXGIFactory6 to be supported.
Signed-off-by: Philip Rebohle philip.rebohle@tu-dortmund.de
dlls/dxgi/factory.c | 40 +++++++++++++++++++++++++++++++++++++++ include/wine/winedxgi.idl | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 39c9e10f7a4..25370e818b9 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -36,6 +36,8 @@ 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_IDXGIFactory7)
|| IsEqualGUID(iid, &IID_IDXGIFactory6) || IsEqualGUID(iid, &IID_IDXGIFactory5) || IsEqualGUID(iid, &IID_IDXGIFactory4) || IsEqualGUID(iid, &IID_IDXGIFactory3)
@@ -462,6 +464,39 @@ 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;
Please add a trace here.
- 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 HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterAdaptersChangedEvent(IWineDXGIFactory *iface,
HANDLE event, DWORD *cookie)
+{
- FIXME("iface %p, event %p, cookie %p stub!\n", iface, event, cookie);
- return E_NOTIMPL;
+}
+static HRESULT STDMETHODCALLTYPE dxgi_factory_UnregisterAdaptersChangedEvent(IWineDXGIFactory *iface,
DWORD cookie)
+{
- FIXME("iface %p, cookie %#x stub!\n", iface, cookie);
- return E_NOTIMPL;
+}
static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = { dxgi_factory_QueryInterface, @@ -498,6 +533,11 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = dxgi_factory_EnumWarpAdapter, /* IDXIGFactory5 methods */ dxgi_factory_CheckFeatureSupport,
- /* IDXIGFactory6 methods */
- dxgi_factory_EnumAdapterByGpuPreference,
- /* IDXIGFactory7 methods */
- dxgi_factory_RegisterAdaptersChangedEvent,
- dxgi_factory_UnregisterAdaptersChangedEvent,
As I said. It would better to split it.
Thanks, Zhiyi
};
struct dxgi_factory *unsafe_impl_from_IDXGIFactory(IDXGIFactory *iface) diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl index 070ac2fddaa..83012047ea7 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 : IDXGIFactory7 { }
On 5/13/20 8:08 AM, Philip Rebohle wrote:
Signed-off-by: Philip Rebohle philip.rebohle@tu-dortmund.de
include/dxgi1_6.idl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
diff --git a/include/dxgi1_6.idl b/include/dxgi1_6.idl index 9dcf9f26b46..9f6d947da28 100644 --- a/include/dxgi1_6.idl +++ b/include/dxgi1_6.idl @@ -34,6 +34,13 @@ typedef enum DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED = 0x4, } DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS;
+typedef enum DXGI_GPU_PREFERENCE +{
- DXGI_GPU_PREFERENCE_UNSPECIFIED = 0,
- DXGI_GPU_PREFERENCE_MINIMUM_POWER = 1,
- DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE = 2,
+} DXGI_GPU_PREFERENCE;
typedef struct DXGI_ADAPTER_DESC3 { WCHAR Description[128]; @@ -96,3 +103,36 @@ interface IDXGIOutput6 : IDXGIOutput5 [out] UINT *flags ); }
+[
- object,
- uuid(c1b6694f-ff09-44a9-b03c-77900a0a1d17),
- local,
- pointer_default(unique)
+] +interface IDXGIFactory6 : IDXGIFactory5 +{
- HRESULT EnumAdapterByGpuPreference(
[in] UINT adapter_idx,
[in] DXGI_GPU_PREFERENCE gpu_preference,
[in] REFIID iid,
[out] void** idx
Typo here. idx should be adapter.
- );
+}
+[
- object,
- uuid(a4966eed-76db-44da-84c1-ee9a7afb20a8),
- local,
- pointer_default(unique)
+] +interface IDXGIFactory7 : IDXGIFactory6 +{
- HRESULT RegisterAdaptersChangedEvent(
[in] HANDLE event,
[out] DWORD *cookie
- );
- HRESULT UnregisterAdaptersChangedEvent(
[in] DWORD cookie
- );
+}
Even though this is a small patch. It would be better to split it to add IDXGIFactory6 and IDXGIFactory7 separately.