From: Conor McCarthy Subject: [PATCH v3 6/7] dxgi: Add a function to IWineDXGIAdapter to receive external memory usage info. Message-Id: <20191125141101.85701-6-cmccarthy@codeweavers.com> Date: Tue, 26 Nov 2019 00:11:00 +1000 In-Reply-To: <20191125141101.85701-1-cmccarthy@codeweavers.com> References: <20191125141101.85701-1-cmccarthy@codeweavers.com> For use by future patched vkd3d and Wine d3d12 modules. Signed-off-by: Conor McCarthy --- 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