[PATCH v3 6/7] dxgi: Add a function to IWineDXGIAdapter to receive external memory usage info.

Conor McCarthy cmccarthy at codeweavers.com
Mon Nov 25 08:11:00 CST 2019


For use by future patched vkd3d and Wine d3d12 modules.

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
v3: Receive the change in memory usage instead of the total.
---
 dlls/dxgi/adapter.c       | 12 ++++++++++++
 include/wine/winedxgi.idl |  5 +++++
 2 files changed, 17 insertions(+)

diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c
index 31b2d5b4..d579475b 100644
--- a/dlls/dxgi/adapter.c
+++ b/dlls/dxgi/adapter.c
@@ -396,6 +396,17 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_get_adapter_info(IWineDXGIAdapter
     return hr;
 }
 
+static void STDMETHODCALLTYPE dxgi_adapter_update_memory_usage(IWineDXGIAdapter *iface,
+        unsigned int non_local, UINT64 bytes_total, INT64 bytes_added)
+{
+    struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface);
+
+    TRACE("iface %p, non-local %u, bytes total 0x%s, bytes added 0x%s.\n", iface, non_local,
+            wine_dbgstr_longlong(bytes_total), wine_dbgstr_longlong(bytes_added));
+
+    wined3d_update_adapter_memory_info(adapter->factory->wined3d, adapter->ordinal, non_local, bytes_total, bytes_added);
+}
+
 static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
 {
     dxgi_adapter_QueryInterface,
@@ -424,6 +435,7 @@ static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
     dxgi_adapter_GetDesc3,
     /* IWineDXGIAdapter methods */
     dxgi_adapter_get_adapter_info,
+    dxgi_adapter_update_memory_usage,
 };
 
 struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface)
diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl
index 070ac2fd..e76e1531 100644
--- a/include/wine/winedxgi.idl
+++ b/include/wine/winedxgi.idl
@@ -82,6 +82,11 @@ struct wine_dxgi_adapter_info
 interface IWineDXGIAdapter : IDXGIAdapter4
 {
     HRESULT get_adapter_info([out] struct wine_dxgi_adapter_info *info);
+    void update_memory_usage(
+        [in] unsigned int non_local,
+        [in] UINT64 bytes_total,
+        [in] INT64 bytes_added
+    );
 }
 
 [
-- 
2.24.0




More information about the wine-devel mailing list