Repository navigation
dxgi_swapchain_test: check CreateSwapChainForHwnd against Microsoft's recorded answers - #4720
kmorales13 wants to merge 2 commits into
Conversation
… recorded answers The 45-case CreateSwapChainForHwnd comparison only had the system DXGI as its reference. Under Wine and Proton that is Wine's or DXVK's DXGI, which accepts 17 descriptions Microsoft's refuses, so the test failed there with 18 mismatches before any of its own swap-chain checks ran. Each case now records Microsoft's HRESULT on a hardware adapter, as measured in ItsNotRexed#3531. The layer is checked against it everywhere. Where the host runtime is Microsoft's, the live comparison stays, and the host must match the recorded answer too. Under Wine the system d3d12.dll and dxgi.dll are no longer loaded.
|
Tested 7b551ee on Windows 11 with an NVIDIA GeForce RTX 4090 and an AMD Radeon iGPU. Both runs pass. I ran All 45 descriptions match the recorded results and the native DXGI results on both runs. For a negative control, I changed the recorded result for NVIDIA driver 32.0.16.2101. AMD driver 32.0.21043.5001. Scope: the Windows swap-chain test. AI-assisted. |
Kam471
left a comment
There was a problem hiding this comment.
Built and ran dxgi_swapchain_test at 7b551eeab on Windows 11, RTX 5070 Ti: PASS, CreateSwapChainForHwnd: 45 descriptions checked against Microsoft's recorded answers and the host runtime, 0 mismatches, 0 validation errors, exit 0; git diff --check clean.
The test now carries Microsoft's recorded answers as a second reference beside the live host runtime, so a host whose DXGI version changes a description no longer silently redefines the expectation, and a layer that matches neither is caught. No blocking issue.
|
Tested
No game files. AI-assisted (Devin). |
|
Tested 7b551ee (merged onto main 98fa503, clean merge, one file) on RTX 3060, driver 580.178.04, Ubuntu 24.04, runtime cross-built with clang-cl 23.1.6 + xwin and run under Wine 9.0. AI-assisted (Claude Code); no game files. The 45 recorded answers work: The test still fails under Wine, one step later: Cause: the test window is never shown. Fix, three lines in HWND w_ = CreateWindowExW(...); // as now
if (w_) ShowWindow(w_, SW_SHOWNOACTIVATE);
return w_;With that on top of this PR the whole test passes: 3 of 3 runs, @kmorales13, this fits in your PR if you want it, so Wine and Proton get a green test instead of the next failure. Not covered: no native Windows run of the |
Under Wine 9.0 on X11 (RTX 3060), ResizeBuffers(0, 0, 0) on the hidden test window kept returning E_FAIL: vkAcquireNextImageKHR reported the new swapchain out of date, because a never-mapped X window doesn't follow SetWindowPos. Showing the window without activating it, as d3d12_present_test and vk_presenter_sync_test already do, fixes that. Only the main window is shown; the 45 comparison windows stay hidden.
|
@ruvenesh Added in 16d16dc, but only for the main test window, which is the one I couldn't reproduce the failure here: Wine 11.22 with its X11 driver (on XWayland) and RADV passes |
|
Independently tested
The resize failure previously reported on an RTX 3060 under Wine 9.0 did not reproduce on this setup. I rebuilt and reran CTest logs are included below with local workspace paths shortened. CTest log — Baseline 98fa503CTest log — Reviewed PR commit 7b551eeCTest log — Updated PR head 16d16dc |
|
Tested 7b551ee on Windows 11 (26300), MSVC 19.44 (VS 2022), scripts/build_runtime.ps1 (Ninja), RelWithDebInfo, NVIDIA GeForce RTX 4070 (driver 617.42, a hardware adapter): pass. This is the native Windows run the description lists as not done: I also read the host fallback: when the system DXGI/D3D12 can't be set up on Windows, AI-assisted: read together with Codex (gpt-6.1-terra); I checked the fallback and summary against the code. |
|
Reviewed on Linux; the C++ side is not buildable in this environment (no cmake/Windows run). The change reads sound: results are seeded to the recorded HRESULT, the host-side comparison runs only when a host device exists, and the previous null-Release path on hosts without D3D12 is gone. host_wine.h resolves in-dir and the ctest target is pre-existing. The recorded-answer table and Wine behaviour need the Windows CI leg (queued at review time) to confirm. The diff also carries the round-43 stacked base. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
READY TO MERGE. Built the head (CMake/Ninja, MSVC 14.51) at /W4: clean. One minor gap: Approve. AI-assisted review, no game files, no game data. |
New TEST item (claim, from this finding).
What and why
dxgi_swapchain_testfails onmainunder Wine and Proton, before any of its own swap-chain checks run. The 45-caseCreateSwapChainForHwndcomparison incompare_swap_chain_argumentshas only the system DXGI as its reference. Under Wine that DXGI is Wine's, and under Proton it is DXVK's. Both accept 17 descriptions that Microsoft's DXGI refuses, for example scalingASPECT_RATIO_STRETCH, the alpha modes, several flags and usages, and width or height 16385. Result: 18 mismatches, then FAIL.Skipping the comparison under Wine would leave those 45 cases unchecked on Linux. So instead, each case now records Microsoft's HRESULT (
want):hostwine::host_is_wine(), as in the other host comparisons): only the recorded answers are checked, and the systemd3d12.dllanddxgi.dllaren't loaded.Where the answers come from
44 of the 45 are measured in #3531, on Windows with hardware adapters:
dac96d2d.The 45th,
usage 0, isn't listed there. The layer returnsS_OKfor it. #3531's full runs atdac96d2dmatched the host on all 45 cases, on an RTX 5070 and an RX 7600 (AMD's driver). Neither later PR that toucheddxgi_com.cpp(#3597, #3280) changed the usage check. So that answer is Microsoft's too.The 16385 answers (
E_INVALIDARG) are a hardware adapter's: WARP accepts 16385. A Windows machine whose default adapter is WARP fails this case, as it did before this change (ours vs host).Tested
CachyOS Linux, Ryzen 7 7700X iGPU (RDNA2, RADV Mesa 26.3.1). Cross-built with clang-cl 23 and the xwin SDK, on
main98fa503f.45 descriptions checked against Microsoft's recorded answers, 0 mismatches, anddxgi_swapchain_testpasses, including present, resize and readback, which never ran under Wine before. Onmain: 18 mismatches, FAIL.dxgi, vkd3d-proton): same, 0 mismatches, PASS.check_hwnd_swap_chainchanged to acceptDXGI_SCALING_ASPECT_RATIO_STRETCH, the Wine run fails on exactly that case (ours 0x00000000, recorded 0x887a0001).Not tested: the native MSVC build and a Windows run, which I don't have. A run of
dxgi_swapchainon Windows would confirm that the host matches all 45 recorded answers.Neighbouring PRs, no shared lines: #4605 edits the adapter block of this test; #4362 adds Wine skips to six other tests; #3679 records Microsoft's answers for other tests.
No game files. AI-assisted (Claude-Opus).