dxgi: Improve tracing in dxgi_adapter_QueryVideoMemoryInfo().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-06-10 11:56:39 +02:00 committed by Alexandre Julliard
parent 019f9222a6
commit 937891cc65
1 changed files with 17 additions and 9 deletions

View File

@ -291,14 +291,18 @@ static void STDMETHODCALLTYPE dxgi_adapter_UnregisterHardwareContentProtectionTe
} }
static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryVideoMemoryInfo(IWineDXGIAdapter *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryVideoMemoryInfo(IWineDXGIAdapter *iface,
UINT node_index, DXGI_MEMORY_SEGMENT_GROUP segment_group, DXGI_QUERY_VIDEO_MEMORY_INFO *memory_info) UINT node_index, DXGI_MEMORY_SEGMENT_GROUP segment_group, DXGI_QUERY_VIDEO_MEMORY_INFO *info)
{ {
struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface); struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface);
struct wined3d_adapter_identifier adapter_id; struct wined3d_adapter_identifier adapter_id;
static unsigned int once;
HRESULT hr; HRESULT hr;
FIXME("iface %p, node_index %u, segment_group %#x, memory_info %p partial stub!\n", TRACE("iface %p, node_index %u, segment_group %#x, info %p.\n",
iface, node_index, segment_group, memory_info); iface, node_index, segment_group, info);
if (!once++)
FIXME("Returning fake video memory info.\n");
if (node_index) if (node_index)
FIXME("Ignoring node index %u.\n", node_index); FIXME("Ignoring node index %u.\n", node_index);
@ -313,26 +317,30 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryVideoMemoryInfo(IWineDXGIAdap
switch (segment_group) switch (segment_group)
{ {
case DXGI_MEMORY_SEGMENT_GROUP_LOCAL: case DXGI_MEMORY_SEGMENT_GROUP_LOCAL:
memory_info->Budget = adapter_id.video_memory; info->Budget = adapter_id.video_memory;
memory_info->CurrentUsage = 0; info->CurrentUsage = 0;
memory_info->AvailableForReservation = adapter_id.video_memory / 2; info->AvailableForReservation = adapter_id.video_memory / 2;
memory_info->CurrentReservation = 0; info->CurrentReservation = 0;
break; break;
case DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL: case DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL:
memset(memory_info, 0, sizeof(*memory_info)); memset(info, 0, sizeof(*info));
break; break;
default: default:
WARN("Invalid memory segment group %#x.\n", segment_group); WARN("Invalid memory segment group %#x.\n", segment_group);
return E_INVALIDARG; return E_INVALIDARG;
} }
TRACE("Budget 0x%s, usage 0x%s, available for reservation 0x%s, reservation 0x%s.\n",
wine_dbgstr_longlong(info->Budget), wine_dbgstr_longlong(info->CurrentUsage),
wine_dbgstr_longlong(info->AvailableForReservation), wine_dbgstr_longlong(info->CurrentReservation));
return hr; return hr;
} }
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetVideoMemoryReservation(IWineDXGIAdapter *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetVideoMemoryReservation(IWineDXGIAdapter *iface,
UINT node_index, DXGI_MEMORY_SEGMENT_GROUP segment_group, UINT64 reservation) UINT node_index, DXGI_MEMORY_SEGMENT_GROUP segment_group, UINT64 reservation)
{ {
FIXME("iface %p, node_index %u, segment_group %#x, reservation %s stub!\n", FIXME("iface %p, node_index %u, segment_group %#x, reservation 0x%s stub!\n",
iface, node_index, segment_group, wine_dbgstr_longlong(reservation)); iface, node_index, segment_group, wine_dbgstr_longlong(reservation));
return S_OK; return S_OK;