On Windows, a DXGI output may support 1920x1440 and 2560x1080 display modes, both of which have the same pixel count. And when finding a mode closest to 2559x1079 or 2561x1081, 1920x1440 is returned.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index 59b23918de3..f5c5e3b786f 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -207,8 +207,9 @@ static unsigned int check_multisample_quality_levels(IDXGIDevice *dxgi_device, #define MODE_DESC_IGNORE_FORMAT 0x00000004u #define MODE_DESC_IGNORE_SCANLINE_ORDERING 0x00000008u #define MODE_DESC_IGNORE_SCALING 0x00000010u +#define MODE_DESC_IGNORE_EXACT_RESOLUTION 0x00000020u
-#define MODE_DESC_CHECK_RESOLUTION (~MODE_DESC_IGNORE_RESOLUTION) +#define MODE_DESC_CHECK_RESOLUTION (~MODE_DESC_IGNORE_RESOLUTION & ~MODE_DESC_IGNORE_EXACT_RESOLUTION) #define MODE_DESC_CHECK_FORMAT (~MODE_DESC_IGNORE_FORMAT)
#define check_mode_desc(a, b, c) check_mode_desc_(__LINE__, a, b, c) @@ -217,10 +218,16 @@ static void check_mode_desc_(unsigned int line, const DXGI_MODE_DESC *desc, { if (!(ignore_flags & MODE_DESC_IGNORE_RESOLUTION)) { - ok_(__FILE__, line)(desc->Width == expected_desc->Width - && desc->Height == expected_desc->Height, - "Got resolution %ux%u, expected %ux%u.\n", - desc->Width, desc->Height, expected_desc->Width, expected_desc->Height); + if (ignore_flags & MODE_DESC_IGNORE_EXACT_RESOLUTION) + ok_(__FILE__, line)(desc->Width * desc->Height == + expected_desc->Width * expected_desc->Height, + "Got resolution %ux%u, expected %ux%u.\n", + desc->Width, desc->Height, expected_desc->Width, expected_desc->Height); + else + ok_(__FILE__, line)(desc->Width == expected_desc->Width && + desc->Height == expected_desc->Height, + "Got resolution %ux%u, expected %ux%u.\n", + desc->Width, desc->Height, expected_desc->Width, expected_desc->Height); } if (!(ignore_flags & MODE_DESC_IGNORE_REFRESH_RATE)) { @@ -1526,7 +1533,8 @@ static void test_find_closest_matching_mode(void) mode.Format = DXGI_FORMAT_R8G8B8A8_UNORM; hr = IDXGIOutput_FindClosestMatchingMode(output, &mode, &matching_mode, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - check_mode_desc(&matching_mode, &modes[i], MODE_DESC_CHECK_RESOLUTION & MODE_DESC_CHECK_FORMAT); + check_mode_desc(&matching_mode, &modes[i], + (MODE_DESC_CHECK_RESOLUTION & MODE_DESC_CHECK_FORMAT) | MODE_DESC_IGNORE_EXACT_RESOLUTION);
memset(&mode, 0, sizeof(mode)); mode.Width = modes[i].Width + 1; @@ -1534,7 +1542,8 @@ static void test_find_closest_matching_mode(void) mode.Format = DXGI_FORMAT_R8G8B8A8_UNORM; hr = IDXGIOutput_FindClosestMatchingMode(output, &mode, &matching_mode, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - check_mode_desc(&matching_mode, &modes[i], MODE_DESC_CHECK_RESOLUTION & MODE_DESC_CHECK_FORMAT); + check_mode_desc(&matching_mode, &modes[i], + (MODE_DESC_CHECK_RESOLUTION & MODE_DESC_CHECK_FORMAT) | MODE_DESC_IGNORE_EXACT_RESOLUTION); }
memset(&mode, 0, sizeof(mode));
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=78411
Your paranoid android.
=== w2008s64 (32 bit report) ===
dxgi: dxgi.c:5556: Test failed: Got unexpected message 0x1a, hwnd 001200FA, wparam 0x18, lparam 0x7e518.