[PATCH v2 5/7] dxgi: Implement IDXGIAdapter3::RegisterVideoMemoryBudgetChangeNotificationEvent().
Conor McCarthy
cmccarthy at codeweavers.com
Thu Nov 14 07:48:29 CST 2019
Used by Hitman 2.
Also implements the unregister function.
Events will only be signalled by updates sent from vkd3d.
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
dlls/dxgi/adapter.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c
index 5507790c..31b2d5b4 100644
--- a/dlls/dxgi/adapter.c
+++ b/dlls/dxgi/adapter.c
@@ -343,15 +343,23 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetVideoMemoryReservation(IWineDXG
static HRESULT STDMETHODCALLTYPE dxgi_adapter_RegisterVideoMemoryBudgetChangeNotificationEvent(
IWineDXGIAdapter *iface, HANDLE event, DWORD *cookie)
{
- FIXME("iface %p, event %p, cookie %p stub!\n", iface, event, cookie);
+ struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface);
- return E_NOTIMPL;
+ TRACE("iface %p, event %p, cookie %p.\n", iface, event, cookie);
+
+ return wined3d_register_adapter_memory_event(adapter->factory->wined3d, adapter->ordinal, event, cookie);
}
static void STDMETHODCALLTYPE dxgi_adapter_UnregisterVideoMemoryBudgetChangeNotification(
IWineDXGIAdapter *iface, DWORD cookie)
{
- FIXME("iface %p, cookie %#x stub!\n", iface, cookie);
+ struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface);
+ HRESULT hr;
+
+ TRACE("iface %p, cookie %#x.\n", iface, cookie);
+
+ if (FAILED(hr = wined3d_unregister_adapter_memory_event(adapter->factory->wined3d, adapter->ordinal, cookie)))
+ ERR("Failed to unregister notification, hr %#x.\n", hr);
}
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc3(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC3 *desc)
--
2.23.0
More information about the wine-devel
mailing list