Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index 874c39b8..ef221b52 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -941,11 +941,12 @@ static void test_adapter_luid(void) static void test_query_video_memory_info(void) { DXGI_QUERY_VIDEO_MEMORY_INFO memory_info; + const UINT64 reservation = 0x100000; + HRESULT hr, non_local_hr; IDXGIAdapter3 *adapter3; IDXGIAdapter *adapter; IDXGIDevice *device; ULONG refcount; - HRESULT hr;
if (!(device = create_device(0))) { @@ -981,6 +982,23 @@ static void test_query_video_memory_info(void) hr = IDXGIAdapter3_QueryVideoMemoryInfo(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL + 1, &memory_info); ok(hr == E_INVALIDARG, "Failed to query video memory info, hr %#x.\n", hr);
+ hr = IDXGIAdapter3_SetVideoMemoryReservation(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, reservation); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter3_SetVideoMemoryReservation(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, 0); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + non_local_hr = IDXGIAdapter3_SetVideoMemoryReservation(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, reservation); + ok(non_local_hr == S_OK || non_local_hr == E_INVALIDARG, "Got unexpected hr %#x.\n", non_local_hr); + + hr = IDXGIAdapter3_QueryVideoMemoryInfo(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &memory_info); + ok(hr == S_OK, "Failed to query video memory info, hr %#x.\n", hr); + ok(memory_info.CurrentReservation == reservation, "Got unexpected current reservation 0x%s.\n", + wine_dbgstr_longlong(memory_info.CurrentReservation)); + + hr = IDXGIAdapter3_QueryVideoMemoryInfo(adapter3, 0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, &memory_info); + ok(hr == S_OK || hr == E_INVALIDARG, "Failed to query video memory info, hr %#x.\n", hr); + ok(memory_info.CurrentReservation == reservation || non_local_hr == E_INVALIDARG, "Got unexpected current reservation 0x%s.\n", + wine_dbgstr_longlong(memory_info.CurrentReservation)); + IDXGIAdapter3_Release(adapter3);
done: