[PATCH v4 0/2] MR11110: dxgi/tests: Skip tests if DXGI 1.4 is not available.
-- v4: dxgi/tests: Add two missing winetest_pop_context. dxgi/tests: Skip tests if DXGI 1.4 is not available. https://gitlab.winehq.org/wine/wine/-/merge_requests/11110
From: Bernhard Übelacker <bernhardu@mailbox.org> DXGI_SWAP_EFFECT_FLIP_DISCARD fails without DXGI 1.4. --- dlls/dxgi/tests/dxgi.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index ecd0661ab25..96e359f50cf 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -7240,8 +7240,9 @@ static void test_frame_latency_event(IUnknown *device, BOOL is_d3d12) IDXGISwapChain1 *swapchain1; ID3D12Device *d3d12_device; ID3D12CommandQueue *queue; - IDXGIFactory2 *factory2; IDXGIFactory *factory; + IDXGIFactory2 *factory2; + IDXGIFactory4 *factory4; ID3D12Fence *fence; UINT frame_latency; DWORD wait_result; @@ -7254,12 +7255,21 @@ static void test_frame_latency_event(IUnknown *device, BOOL is_d3d12) get_factory(device, is_d3d12, &factory); hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory2, (void**)&factory2); - IDXGIFactory_Release(factory); if (FAILED(hr)) { win_skip("IDXGIFactory2 not available.\n"); + IDXGIFactory_Release(factory); return; } + hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void**)&factory4); + if (FAILED(hr)) + { + win_skip("IDXGIFactory4 not available.\n"); + IDXGIFactory_Release(factory); + return; + } + IDXGIFactory4_Release(factory4); + IDXGIFactory_Release(factory); window = create_window(); @@ -7983,12 +7993,25 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12) ID3D12CommandQueue *queue; IDXGISwapChain *swapchain; ID3D12Fence *fence; + IDXGIFactory *factory = NULL; + IDXGIFactory4 *factory4; + BOOL supports_dxgi14 = FALSE; unsigned int i; HWND window; HRESULT hr; window = create_window(); + /* Query if factory supports DXGI 1.4 */ + get_factory(device, is_d3d12, &factory); + ok(!!factory, "Failed to get factory.\n"); + if (SUCCEEDED(hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void **)&factory4))) + { + IDXGIFactory4_Release(factory4); + supports_dxgi14 = TRUE; + } + IDXGIFactory_Release(factory); + for (i = 0; i < ARRAY_SIZE(tests); ++i) { DXGI_SWAP_EFFECT swap_effect = tests[i].swap_effect; @@ -7998,6 +8021,13 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12) if (is_d3d12 && (swap_effect == DXGI_SWAP_EFFECT_DISCARD)) continue; + /* DXGI_SWAP_EFFECT_FLIP_DISCARD needs DXGI 1.4 */ + if (!supports_dxgi14 && swap_effect == DXGI_SWAP_EFFECT_FLIP_DISCARD) + { + win_skip("Skip test with DXGI_SWAP_EFFECT_FLIP_DISCARD.\n"); + continue; + } + winetest_push_context("test %u", i); swapchain = create_swapchain(device, is_d3d12, window, flags, swap_effect); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11110
From: Bernhard Übelacker <bernhardu@mailbox.org> --- dlls/dxgi/tests/dxgi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index 96e359f50cf..8949af69142 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -7107,7 +7107,10 @@ static void test_cursor_clipping(IUnknown *device, BOOL is_d3d12) } ok(mode_idx < mode_count, "Failed to find a different mode than %ux%u.\n", width, height); if (mode_idx >= mode_count) + { + winetest_pop_context(); continue; + } ret = ClipCursor(NULL); ok(ret, "ClipCursor failed, error %#lx.\n", GetLastError()); @@ -8278,6 +8281,7 @@ static void run_on_d3d12(void (*test_func)(IUnknown *device, BOOL is_d3d12)) if (!(device = create_d3d12_device())) { skip("Failed to create Direct3D 12 device.\n"); + winetest_pop_context(); return; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11110
v4: - Split mising winetest_pop_contexts into separate commit. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11110#note_142988
On Fri Jun 12 17:44:11 2026 +0000, Henri Verbeet wrote:
This line is against the crash that gets hit after avoiding the first one, visible here: https://testbot.winehq.org/JobDetails.pl?Key=163329&f203=exe32.report#k203
This shows `dxgi.c:8010: Test failed: d3d10: test 1: Failed to create swapchain, hr 0x887a0001.`
So, yes, this seems to be about DXGI_SWAP_EFFECT_FLIP_DISCARD. IIRC the issue there is that DXGI_SWAP_EFFECT_FLIP_DISCARD is introduced by DXGI 1.4, which is part of Windows 10. We should probably just check for DXGI 1.4 support before trying to use DXGI_SWAP_EFFECT_FLIP_DISCARD. In practice the easiest way to do that is probably to QI the IDXGIFactory interface for IID_IDXGIFactory4. I fear there is now to much in this MR, should I at least put the missing winetest_pop_context into a separate MR? Personally I tend to split MRs when I think I can get away with it, so as far as I'm concerned that makes sense. Thanks, I replaced all these brokens by a query to the factory4 interface and moved the pop_context at least into its own commit.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11110#note_142991
participants (2)
-
Bernhard Übelacker -
Bernhard Übelacker (@bernhardu)