test(agc): enable VK_KHR_portability_subset in the tests that create their own device #10920
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10920"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by maximilianfv on 2026-10-25T10:06:10Z.
What
Thirteen AGC tests create their own Vulkan device with
vkCreateDevice:BdaDevice.cpp,PerformanceOverlay.cpp,PresentationPass.cpp,Recorder.cppand, undertests/execution/,DepthPlaneGuestLayers.cpp,DepthStorage.cpp,DepthSurfaceLastWriter.cpp,NativeMultisampleDepth.cpp,OversizedDescriptorSets.cpp,PartiallyResidentSnapshot.cpp,PooledBufferRange.cpp,SampledCacheBudget.cppandSparseBufferHoles.cpp. None of them enablesVK_KHR_portability_subset, which the spec requires whenever the physical device advertises it, so on MoltenVK each of these devices logsVUID-VkDeviceCreateInfo-pProperties-04451. Four of them (BdaDevice.cpp,Recorder.cpp,OversizedDescriptorSets.cpp,SampledCacheBudget.cpp) do not yet request portability enumeration at instance creation onmain, so there the loader does not show them MoltenVK and the helper does nothing until they do; mugurc's macOS series adds that instance flag.Enabling the extension alone is not enough: every subset feature then counts as off, so
VkPhysicalDevicePortabilitySubsetFeaturesKHRwith the values the device reports must be chained intoVkDeviceCreateInfoas well.A new test header,
tests/PortabilitySubset.hpp, enumerates the device extensions. When the subset is advertised, it adds the extension, queries the subset features withvkGetPhysicalDeviceFeatures2(all thirteen instances are Vulkan 1.1) and chains them intoVkDeviceCreateInfo. In every case it sets the extension count and names from the test's extension vector. On a device without the subset it only does that. The subset struct and itssTypeare guarded byVK_ENABLE_BETA_EXTENSIONSin the Vulkan headers, so the CMake change defines it for these thirteen sources only. InDepthPlaneGuestLayers.cppandPartiallyResidentSnapshot.cpp, theconst std::arrayextension list became astd::vectorso the helper can append to it. InPerformanceOverlay.cppthe optional memory-budget extension is now pushed into a vector instead of being passed through a pointer. The tests that enabled no extensions now pass an empty vector.VulkanDevice.cppis not touched. Onmainit does not enable the subset. mugurc's macOS series enables it there without chaining the features (20ee39de9a, "feat(agc): create the Vulkan device on MoltenVK"), and that part is left to the series.Prior work and credit:
imageViewFormatSwizzle-04465andimageViewFormatReinterpretation-04466instead, and chaining the queried features cleared them in the two fixtures tried. He noted that this needsVK_ENABLE_BETA_EXTENSIONSand left it out of #7886, which used instance-level portability enumeration for the same nine fixtures and is the precedent for handling portability in each test: https://github.com/boykopovar/AnyPS5/pull/7886#issuecomment-6356775389VUID-VkSamplerCreateInfo-samplerMipLodBias-04467, and that with the features chained neither error appears. He offered the tests part to whoever takes it: https://github.com/boykopovar/AnyPS5/pull/10540#issuecomment-6388121653 . I took it here: https://github.com/boykopovar/AnyPS5/pull/10540#issuecomment-6395961829VulkanDevice.cpponly, also without chaining the features. It changes other tests, but not the device creation in these thirteen.No code was ported from any of these.
Tested
Apple M1 Pro, macOS 27.0.1, x86_64 build under Rosetta 2, Vulkan through MoltenVK from the LunarG Vulkan SDK 1.4.363.
mainalone does not build on macOS, so the tree is mugurc's macOS series (ci/macos-series-2, 27e968974) merged withmainat2742004ed2, plus other open macOS fixes. Only this change was toggled. Both runs usedANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest -Von the 103 tests that these thirteen binaries run.Validation ErrorlinespProperties-04451imageViewFormatSwizzle-04465The skipped test is
agc_driver_oversized_descriptor_sets(the device binds fewer than 4097 storage buffers per stage or set). It still creates the changed device before it skips, and its 04451 is gone with the change.agc_performance_overlay: the process's private memory can't be read on macOS (open #9971).agc_driver_pooled_buffer_range: a MoltenVK robust-access difference.agc_driver_recover_srgb_allocation.04465errors come from the same four tests in both runs:agc_driver_native_multisample_depth,agc_driver_native_depth_retirement,agc_driver_native_depth_clearsandagc_driver_native_depth_clear_refusals. Without this change no test device enables the subset, so these errors come from the driver's own device in the macOS series, not from the devices this PR changes.was not found but was requested by env var VK_INSTANCE_LAYERSline appears in either log, and the change adds no newVUID-.I could not run the same tests on
mainbecausemaindoes not build on macOS. Linux and Windows were not tested. Native drivers there don't advertise the portability subset, so the change only rebuilds the extension list; a device that does advertise it gets the same handling as MoltenVK.uv run tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:11:37Z.
Review: COMMENTED
I reviewed the changed device-creation paths and ran the repository convention check and diff whitespace validation. One macOS device-enumeration gap is described in the review comment below; I am holding approval until it is addressed or explained.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:19:10Z.
Review: COMMENTED
I reviewed the exact head
e04a7ecf48b09d18278073319e67770c64486f58and the portability-subset feature-chain change. The changed fixtures addVkPhysicalDevicePortabilitySubsetFeaturesKHRto the device-createpNextchain beforevkCreateDevice;PortabilitySubset::Enablechecks the extension and supported feature bits before adding the extension to the create info. I initially flaggedNativeMultisampleDepth.cpp, then verified its macOS instance portability-enumeration extension and flag already exist onmainand withdrew that point.git diff --checkandpython3 tools/check_conventions.py --base upstream/main --head upstream/pr-10920pass. The available hosted eligibility, conventions, intake, labels, and report checks pass; product test jobs are skipped by path filters, so I am not claiming a runtime test from CI. I found no remaining blocking issue in this focused review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:33:00Z.
Review: COMMENTED
I rechecked exact head
e04a7ecf48b09d18278073319e67770c64486f58after your reply. The existingNativeMultisampleDepth.cppsetup already enables the instance portability-enumeration flag and extension; your correction is accurate, and my earlier comment on that file was mistaken.I also reran
git diff --check upstream/main...upstream/pr-10920andpython3 tools/check_conventions.py --base upstream/main --head upstream/pr-10920; both pass. The focused test change is still awaiting a runnable Vulkan-host validation on a portability-subset device. The added helper appends the reported extension and queries/enables its feature struct; most call sites chain that struct ahead of the previous feature chain. InRecorder.cpp, however, the preexisting feature chain includes BDA/8-bit-storage and optionally dynamic-rendering, GPL, descriptor-indexing and robustness2 structs. Please confirm on an advertised-subset device that the final chain retains all of those entries and the selected feature values, sinceEnable()inserts the portability struct by rewriting its ownpNextanddevice.pNext.No product suite was run locally here. Hosted build/product paths are skipped for this test-only change, so I am leaving this as a comment pending that portability-device validation rather than approving from the policy checks alone.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:38:00Z.
Review: APPROVED
Reviewed exact head
e04a7ecf48b09d18278073319e67770c64486f58. The portability-subset helper preserves the existingpNextchain and enables the extension only when advertised. The author's M1 Pro/MoltenVK validation compares all 103 tests run by the affected binaries with and without the change; the recorder's 69 tests drop from 64 portability VUIDs to zero, with no new VUIDs. My earlier NativeMultisampleDepth setup concern was incorrect because the unchanged base already enables instance portability enumeration.git diff --checkandcheck_conventions.pypass. Product CI jobs are skipped by path filters; the GPU validation above is author-reported, not independently rerun here.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T03:18:39Z.
Review: COMMENTED
Build report on Apple silicon at head
e04a7ecf48: on currentmainthe ninetests/execution/sources this PR changes no longer compile, because of the shared precompiled header that #10164 added after this branch's last push.Machine: Apple M2 Max, macOS 27.2, Apple clang 21 (Xcode 27), x86_64 Release under Rosetta 2, Ninja,
BUILD_TESTING=ON.Tree:
main27ad7244d2with the open macOS build PRs merged on top (#10366, #7631, #10659, #10660, #11249, #11358, #11047, #11048, #10669, #9263, #8477, #10876, #10552, #7804, #10540, #10676, #11447, #11437, #11554, #11119, #11049), plus this PR, which merges cleanly. That isn't plainmain, butmainalone doesn't build libkernel on macOS, and none of those PRs touches the execution tests or the PCH.All nine changed execution tests fail the same way (
DepthPlaneGuestLayers,DepthStorage,DepthSurfaceLastWriter,NativeMultisampleDepth,OversizedDescriptorSets,PartiallyResidentSnapshot,PooledBufferRange,SampledCacheBudget,SparseBufferHoles):The compile line does have
-DVK_ENABLE_BETA_EXTENSIONS. Since3fe7aaf3b4, though, every execution test reuses one PCH (REUSE_FROMthe first execution target), and that PCH includesVulkanTestDevice.hpp, so<vulkan/vulkan.h>, without the define. By the time the source is compiled, the Vulkan headers have already been included without the beta part, and their include guards keep it out. Clang uses the PCH and doesn't warn that the macro differs. I haven't checked how GCC handles it.Including
<vulkan/vulkan_beta.h>inPortabilitySubset.hppisn't enough: it supplies the struct and the extension name, but theVkStructureTypevalue is invulkan_core.hunder the same define. What did work: defining it for every execution test, so the shared PCH is built with it too. I added it in the foreach loop that creates the execution tests (the per-source property can then drop the nine execution sources):With that, the nine sources and the whole tree build again; the only remaining failures are two
core/libs/testsobjects that this PR doesn't touch. The four non-execution sources (BdaDevice.cpp,PerformanceOverlay.cpp,PresentationPass.cpp,Recorder.cpp) don't use the shared PCH, so their per-source property still works.I haven't run the changed tests on the GPU in this tree yet.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.