Repository navigation
tests: count the SDK 1.4.363 swapchain-flags validation message apart, as the sRGB one - #9340
bailu12300 wants to merge 1 commit into
Conversation
…tion message on Windows SDK 1.4.363, so count it apart The validation layer built with Vulkan SDK 1.4.363 reports, once per vkCreateSwapchainKHR, "pCreateInfo->flags has VkSwapchainCreateFlagBitsKHR values (VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR) that require the extensions VK_KHR_swapchain_mutable_format" (VUID-VkSwapchainCreateInfoKHR-flags-parameter, id 0xa4ba1dd3), even when the flags passed are 0. Measured on Windows 11 26100 + RTX 5060 (driver 32.0.16.2124) with a standalone program that creates a hidden window, a Win32 surface and a swapchain with flags 0 and enables nothing else: it prints flags 0 itself and still gets the message, and the same message comes for the case that really passes the mutable-format bit. With LEONIDA_VK_VALIDATION=1 that made four swapchain tests fail on "any validation error": d3d12_present, xbox_present, dxgi_swapchain and vk_presenter_sync. The message is now counted apart like the sRGB swapchain STORAGE one, and those four tests skip (77) when it is the only validation error, so a run on that SDK no longer fails on a message the code cannot cause. Without the layer all four still pass.
al3xar
left a comment
There was a problem hiding this comment.
Independent Windows + GPU + Vulkan SDK 1.4.363.0 verification of 1157ea52f (AI-assisted).
- Environment: Windows 11 x64, MSVC 19.44.35230.0 (Ninja Release), Windows SDK 10.0.26100.0, NVIDIA GeForce RTX 3060 (driver
621.24), Vulkan SDK1.4.363.0, no game files. - Test runs (
LEONIDA_VK_VALIDATION=1):vk_presenter_sync_test: PASS (exit 0)d3d12_present_test: PASS (exit 0)xbox_present_test: PASS (exit 0)dxgi_swapchain_test: PASS (exit 0)
- Test runs (validation off): all 4 PASS (exit 0).
- Observation & code review:
- On this clean Vulkan SDK
1.4.363.0+ RTX 3060 (621.24) host,0xa4ba1dd3did not fire (likely an implicit third-party/overlay Vulkan layer on the reporter's host mutatingpCreateInfo->flagsbeforeVK_LAYER_KHRONOS_validation), so all 4 tests passed withexit 0and 0 known/unknown validation errors rather than skipping. - The filtering logic mirrors the existing
known_srgb_swapchain_storage_errorpattern cleanly: tests still fail on any unknown validation error, skip (77) only when all validation errors are known layer false positives, and pass (0) when none occur. Built with 0 new MSVC warnings.
- On this clean Vulkan SDK
LGTM.
|
Tested
AI-assisted (Claude Code). Synthetic test only, no game files. |
|
Data point on where the message comes from: the same Vulkan SDK (1.4.363.0) doesn't produce it here. Windows 11 26200, RTX 3070 (NVIDIA 610.88, Vulkan 1.4.341), MSVC 14.44, So it isn't the 1.4.363 validation layer on its own. An app that passes The obvious candidate on an NVIDIA machine is the driver's own implicit A one-variable check on your machine: $env:DISABLE_LAYER_NV_PRESENT_1 = "1" # the disable variable from its manifest
$env:LEONIDA_VK_VALIDATION = "1"
ctest --test-dir runtime/build -R "^(vk_presenter_sync|d3d12_present|xbox_present|dxgi_swapchain)$" --output-on-failureIf the message disappears, the comments in the PR ("the validation layer built with Vulkan SDK 1.4.363 reports ...") name the wrong source. Disabling that layer under validation might then be better than skipping. Either way, matching on the message ID alone would also hide a real flags error from our own code (one that sets the bit without the extension). One option is to count it as known only when the create info we passed had AI-assisted (Claude Code). No game files. |
|
Tested 1157ea5 (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11 (build 26200), Vulkan validation layer on (
Ran the tests that belong to the test files this PR changes (ctest entries, or the test program directly when it is not registered), with no game files ( |
Claim: coordination issue #9065.
What and why
With
LEONIDA_VK_VALIDATION=1on Windows, four swapchain tests fail on their "any validation error fails the test" rule:and every one of them fails on the same message, once per swapchain creation:
VUID-VkSwapchainCreateInfoKHR-flags-parameter, message id0xa4ba1dd3.The presenter passes
flags = 0. I instrumentedruntime/src/vulkan_present.hright before the call and the test's ownvkCreateSwapchainKHRwrapper, and both printedflags = 0,pNextnull,imageUsage18/19 — so the bit is not in our struct. To rule our code out entirely I then wrote a standalone program that shares nothing with the repository: a hidden Win32 window, aVK_KHR_win32_surfacesurface, one queue,vkCreateSwapchainKHRwithflags0 (and, as a control, withVK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR), andVK_LAYER_KHRONOS_validationplus a debug messenger:So on Windows 11 26100 + RTX 5060 (driver 32.0.16.2124) with the Vulkan SDK 1.4.363 validation layer, a creation with flags 0 is reported as if it asked for the mutable-format bit. That is a validation-layer message this code cannot cause.
Fix
The repository already counts one such known false positive apart (
known_srgb_swapchain_storage_error, matched by message id, withknown_validation_errors()so a test skips only when it is the sole error). This adds the second, the same way:runtime/test/vk_test_device.h:known_swapchain_flags_error()matches 0xa4ba1dd3, counts into the known total, and the printed message is marked.runtime/test/dxgi_swapchain_test.cpp: its own counter gets the same match.d3d12_present_test.cpp,xbox_present_test.cpp,vk_presenter_sync_test.cpp: fail only when validation errors exceed the known ones, otherwise report them and return 77 (all four already haveSKIP_RETURN_CODE 77).Tested
Windows 11, NVIDIA GeForce RTX 5060, driver 32.0.16.2124 (621.24), Vulkan SDK 1.4.363:
LEONIDA_VK_VALIDATION=1 ctest -R "^(d3d12_present|xbox_present|dxgi_swapchain|vk_presenter_sync)$": before, all four Failed; after, all four***Skipped,100% tests passed, 0 tests failed out of 4.Passed×4,100% tests passed.LEONIDA_VK_VALIDATION=1 ctest -R "^d3d12_":95% tests passed, 5 tests failed out of 99— depth_resolve (d3d12_depth_resolve_test: a refused list submits nothing, so do not compare the destination #9066), indirect_rt (d3d12: an ARRAY_OF_POINTERS entry below the arena is not an overflow (d3d12_indirect_rt on NVIDIA) #6010), pso_validation (d3d12_pso_validation_test: compare the DYNAMIC_* PSO flags with the host only where it reports them (Windows 10) #8540), mesh (Runtime: mesh-draw statistics segments count no clipping (VUID-07076); clipping from mesh-primitives queries #7112), set_descriptor_heaps (d3d12_set_descriptor_heaps_test: set the heap-direct root-signature flag word by hand where the host serializer refuses it (Windows 10) #7718), all with their own open PRs;d3d12_presentno longer among them.AI-assisted: yes