fix(agc): honor enabled storage MSAA for placeholders #7573
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7573"
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 MarcZX10 on 2026-10-18T15:02:46Z.
What
The sampled-cache test fixture created multisampled storage placeholder images even when its Vulkan device had not enabled
shaderStorageImageMultisample. The fixture now enables the optional feature whenever the selected device supports it, across the default and resource test modes. When the feature is unavailable or deliberately disabled,PlaceholderImagesuses single-sample storage placeholders instead. A new CTest mode disables the feature to exercise that fallback.Fixes #7569.
Tested
Linux, current
maine5f18ea99:cmake -S . -B build-pr -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_AGC_EXECUTION_TESTS=SampledCacheBudgetconfigured successfully.cmake --build build-pr --target agc_driver_sampled_cache_budget_tests --parallel 4passed. GCC 12 first stopped at an existing dependent-template parser error inSrtDescriptorEvaluation.cpp; I applied its one-wordtemplatequalifier only in the disposable build worktree, not in this PR.without-storage-image-multisample, with Vulkan required. Both aborted before Vulkan initialization because this host's Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. No runtime or GPU validation pass is claimed.python3 tools/check_conventions.py --base upstream/main,python3 tools/pr_overlap.py --branch codex/agc-sampled-cache-msaa-feature, andgit diff --checkpassed.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T15:33:55Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/CMakeLists.txtL2039Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T15:40:06Z.
Updated verification: corrected headfd872264e passes on both GPUs
@MarcZX10 The typed-MSAA source concern below is addressed at
fd872264e2e34adecc24737873194c94b238c525. I merged that exact head into our main91ddd-based validation integration with #7570's actual-device selector. The resulting frozen compositione41aa8ef34 is pushed oncodex/validate-peer7573-fd-sonic-main91. Only the CMake insertion conflicted; both selector registrations and your disabled-feature registration were retained. This is a test of that composition, not your standalone head or latest main.Full Windows runtime/test build passed. Seven GPU groups, each in3 fresh processes on each actual GPU, passed: default sampled cache, memory, without storage-image MSAA, three resource-admission/clear modes and actual-device selection. The CPU placeholder-shape and selector groups also passed3 times each: 21 NVIDIA GPU +21 AMD GPU +6 CPU passes; no failures/skips; max4.76s. Khronos validation1.4.363.0 loaded for all42 GPU processes; zero VUIDs, validation errors or warnings. Both the CPU shape check and disabled-feature runtime check exercise the new unavailable-slot rule; no single-sample replacement is used.
Matched preceding composition893f303a5f, without #7573, reproduced six
VUID-VkImageCreateInfo-usage-00968validation errors per ordinary-default process,3/3 on each actual GPU, despite passing behavior assertions. These errors are absent in all corrected runs. The current fixture assertions also require every typed MSAA-storageViewrequest to throw when the feature is disabled.Hardware: NVIDIA GeForce RTX5080
10de:2c02, driver610.62/32.0.16.1062; AMD Radeon(TM) Graphics1002:13c0, driver32.0.21036.18; Windows11 Enterprise26200. These GPUs support storage-image MSAA; the disabled case tests it deliberately not enabled on the logical device. This is not a physically feature-absent-device run, a title unblock or a full-suite claim. The separate MoltenVK report remains independent evidence.AI-assisted validation/report: yes (Codex).
Original source review of head5394684198 (addressed by
fd872264e)@MarcZX10 Thank you for picking up #7569. I checked the public-source change before starting a duplicate fix.
There is one correctness issue in
PlaceholderImages.cpp: replacingshape.sampleswithVK_SAMPLE_COUNT_1_BITchanges the image behind a typed multisampled storage heap into a single-sample image.PlaceholderImageShapeOfand the shader heap type still describe that heap as multisampled. The Vulkan SPIR-V environment, VUID-RuntimeSpirv-samples-08726, requires anOpTypeImagewithMS=1to bind an image with more than one sample. The new fixture only uses its ordinary single-sample resources, so passing it would not establish that this substituted multisample heap can be consumed correctly.Could the disabled-feature path leave those storage-MSAA slots unavailable, preserving the shape, and let the existing
PlaceholderImages::Viewrefusal handle an actual request? A regression should verify that disabled-feature MSAA storage heaps cannot return a single-sample placeholder, while supported single-sample storage and sampled-MSAA heaps retain their shapes. The fixture can still enable the supported feature normally, as your patch does.This is a source/specification review, not a claimed GPU reproduction of the new path. Our current Sonic transaction is using its frozen build; I can supply actual AMD/NVIDIA validation afterward. Our #7570 selector is separate, and its author coordination with #6937 is already recorded; we should retain that actual-device reporting in any validation composition.
AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T15:49:24Z.
Independent Windows validation for #7569/#7573, coordinated with #7570 and #6937:
I reproduced six
VUID-VkImageCreateInfo-usage-00968diagnostics in the legacy default mode on each actual GPU: AMD Radeon(TM) Graphics (1002:13c0, Windows driver 32.0.21045.5002) and NVIDIA GeForce RTX 5090 (10de, Windows driver 32.0.16.1714), Windows 11 Pro 10.0.26300. Behavioral assertions passed despite those errors. The other selected GPU modes had no validation errors or warnings.I then composed your pinned head
5394684198bc90e65afab15bda4240e1fb4b6c46onto local #6937/#7570 integrationb4782b8a9eb0dc3f31eb3e62039d40b88801a99b, yielding5fbe8b50449fb8adb422d54fdf27047d5ff37e98. Only the CMake insertion conflict needed resolution: retain both the selector registrations and your disabled-feature registration. The common selector and #6937 guards remain intact. This is an unpublished local composition, not a test of your standalone head or latest main.A fresh focused Windows build passed. With LunarG VK_LAYER_KHRONOS_validation 1.4.363.0 actually loaded (verified loader insertion and actual fixture physical-device lines), the 13-case matrix passed on both requested GPUs: 26 behavioral passes, 0 failures, 0 skips. Of these, 24 are GPU executions with zero validation errors and zero validation warnings; two are CPU selector executions. The new
agc_driver_sampled_cache_budget_without_storage_image_multisamplecase and ordinary default case both passed cleanly on each GPU. The five pending-write cases retained all RGBA/source-word/guard/publication/retirement success oracles. Source, executable, PRX and layer hashes remained stable within each run.The matrix covers default, memory, disabled storage-MSAA, three resource modes, actual-device selection, CPU selection, and #6937's five cases. These bounded initialization/cache tests do not establish every production shader's behavior with optional features disabled, a full-suite pass, Linux coverage, or a title unblock. No duplicate implementation or PR was created. Please retain coordination with #7570 around the common constructor/registration conflict before landing.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T15:56:59Z.
Apple GPU / MoltenVK run with the Khronos validation layer. Unlike the AMD/NVIDIA runs above, here the feature is actually missing on the device rather than disabled by the fixture. That makes it matter outside the fixture too: MoltenVK reports
shaderStorageImageMultisample = falseandnullDescriptor = false, but its image format properties still allow 4 samples with storage usage. So the productionVulkanDevicecreates the multisampled storage placeholders without the feature as well.Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head
539468419. Method: macos-port @ b7eb6b6b + ImportWatched + PR diff, not main. The port has noContext::storageImageMultisample, so I added the 4-line stand-in from main (field inContextand the device state, set fromenabled.shaderStorageImageMultisampleinVulkanDevice, copied into the graphics context). The fixture and CMake hunks were applied by hand (the port's fixture also has a__APPLE__loader branch). Driver: MoltenVK 1.4.2 (Vulkan SDK 1.4.363),VK_LAYER_KHRONOS_validation1.4.363,ANYPS5_NO_SHADER_CACHE=1.VUID-VkImageCreateInfo-usage-00968errors per run:agc_driver_sampled_cache_budget_tests resource-admission... resource-oversized... resource-clear... without-storage-image-multisampleVulkanDevice(agc_driver_cross_workgroup_flag_tests, which only opens the device)PlaceholderImages.cpphunk. With only the fixture and CMake changes, the resource modes still pass and still log 6 errors each. So the new CTest mode doesn't catch a regression unless the validation layer is on.^agcsuite with the PR (SDK driver,-j1 --timeout 30, flip/display/lds_atomics64 excluded): 14 failures out of 434, the same set as the unchanged port.agc_driver_cross_workgroup_flagis intermittent on this machine and also fails on the unchanged port.On @Amoenus's point: I also ran the alternative,
continueinstead of substituting one sample, so the slot is left empty when the feature is off. On this device that variant also gives 0 errors in every run above. The full^agcsuite gives the same 14 failures, and no test hits theViewrefusal ("no placeholder image for typed image heap"). That fits the emitter: it refuses a multisampled storage image type withoutCapabilityStorageImageMultisample(SpirvDescriptors.cpp, same check on main). So in this suite nothing asked for that slot, and leaving it empty cost nothing even withoutnullDescriptor. This only covers what the port's suite exercises, not titles.GPUs tested: Apple M2 Max (MoltenVK 1.4.2)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:02:44Z.
Follow-up: I pushed
fd872264eto keep typed multisampled storage placeholders unavailable whenevershaderStorageImageMultisampleis not enabled. The typed shape remains multisampled; the code no longer substitutes an incompatible single-sample image, andPlaceholderImages::Viewrefuses an unavailable slot.The placeholder-shape test now checks that disabled-feature storage-MSAA shapes are unavailable while sampled-MSAA and single-sample shapes retain their original sample count, view type and usage. The
without-storage-image-multisamplefixture also asserts that every typed multisampled storage heap refuses a placeholder.Validation on this host: both modified C++ translation units pass syntax compilation,
agc_placeholder_images_testspasses,git diff --checkpasses, andtools/check_conventions.py --base upstream/mainpasses. I compiled the updated Vulkan fixture and constructor together, but could not complete its runtime case: this Linux host's CPU guard stops execution because its Xeon E5-1620 v2 lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA. I am not claiming a local Vulkan runtime pass. The updated hosted checks are still running.I manually checked the #7570 overlap: the shared path is the CMake test-registration area; this PR's placeholder feature behavior does not depend on #7570.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:03:38Z.
Hosted check update for
fd872264e: eligibility, conventions, and progress report passed; relinker, Linux, and Windows build jobs were skipped by the workflow. The PR is OPEN/CLEAN. Local Vulkan runtime remains unverified on this host because the CPU guard stops execution before the test.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:06:00Z.
Thanks for checking this on MoltenVK with the feature absent on the device. That confirms the same invariant beyond the AMD/NVIDIA fixture case: the typed multisampled storage image cannot be replaced with a 1-sample placeholder. The updated head now omits the placeholder when storage MSAA is unavailable and keeps the original shape when supported; I recorded the local CPU-only checks and the host CPU limitation above.