Repository navigation
test(agc): skip the MSAA storage-promotion remap on sample-order devices - #9455
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The focused before/after reproduction is useful, but this test is under libSceAgcDriver, and the repository rule requires the same focused test on main and this change with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Please attach both logs, confirm neither reports the requested layer missing, and compare for new VUID- messages. The current report mentions only ANYPS5_NO_SHADER_CACHE=1, so I am holding approval until that required validation evidence is recorded. Hosted full Linux/Windows jobs were skipped; I did not run the Vulkan test locally.
|
Ran the required validation-layer comparison for
Log: main, RTX 3070Log: this change, RTX 3070Log: main, lavapipeLog: this change, lavapipeLayer insertion (
|
|
Ran
The HD 630 is the case listed here as not run: a 1x1 grid without the feature, so the target is color-only and this PR's condition is false; |
|
Linux, llvmpipe (LLVM 23.1.1, 256 bits) via lavapipe, Mesa 26.2.4, Head. Negative control. Why 25.2.8 and 26.x disagree. @GiannisG1's llvmpipe on Mesa 25.2.8 (#9455 (comment)) logs no grid and passes with AI-assisted: yes (Claude Code); runs on this machine. |
|
Some 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.
|
|
AMD and a second NVIDIA generation.
None of the three has the 1x1 grid that makes |
|
@MarcZX10 Adding the Apple run of the required comparison, same focused test, same three variables,
Why Apple fails both ways: MoltenVK reports a 1x1 sample-location grid at 2 and 4 samples, so Log: base, MoltenVK 1.4.2 (SDK)Log: this change, MoltenVK 1.4.2 (SDK)Log: base, MoltenVK main + #2704Log: this change, MoltenVK main + #2704Layer insertion (
|
A device with programmable sample locations but only a 1x1 location grid (for example lavapipe) creates its multisampled color targets with storage usage from the start, so the guest sample order can be written back. MultisampleTargetStorageView then returns that already-storable image and makeStorable is a no-op, so there is no promotion allocation to retire and the generation does not change. StorageRemap asserted the opposite and failed deterministically with "MSAA storage promotion did not retain its source image". Skip StorageRemap on such devices, mirroring OrderRemap, which already runs only there. The born-storable targets lifetime stays covered by OrderRemap; StorageRemap keeps covering the promotion path on devices whose MSAA targets are not born storable (for example NVIDIA, whose 4x grid is 2x2).
…e-order devices StorageTwin asserts that a storage access promotes the rendered target to a new image. On a device that writes the guest sample order back (MayReorderSamples with a storage format, such as lavapipe with its 1x1 sample-location grid) the target is born storable, so the storage view is the rendered image and the case fails with "MSAA storage promotion kept the rendered image", the same reason StorageRemap failed. Expect the same image there, and a new one everywhere else.
eb6f3f9 to
0069118
Compare
|
@MarcZX10 Update: on current
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine. |
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked both commits: the |
What
agc_driver_multisample_retirementfails deterministically on some devices withMSAA storage promotion did not retain its source image(MultisampleRetirement.cpp, inStorageRemap). This happens on a device with programmable sample locations but only a 1x1 location grid (for example lavapipe):MayReorderSamplesis true there, so the driver creates the multisampled color target with storage usage from the start to write the guest's sample order back.MultisampleTargetStorageViewthen returns that already-storable image andmakeStorableis a no-op, so storage access does not allocate a new image and the owner's generation does not change.StorageRemapasserted the opposite (promoted.generation != old.generation), which only holds when the target is not born storable.The fix skips
StorageRemapon exactly those devices, mirroringOrderRemap, which uses the sameMayReorderSamples && SampleOrderStorageFormat != VK_FORMAT_UNDEFINEDcondition and already runs only there. No coverage is lost: the born-storable target's retirement lifetime is covered byOrderRemapon those devices, andStorageRemapstill exercises the promotion path (a storable image allocated on first storage access, retiring the color-only owner) on every device whose MSAA targets are not born storable — for example NVIDIA, whose 4x sample-location grid is 2x2, soMayReorderSamplesis false and the target is created color-only.StorageTwin(added tomainin4375cf06a,fix(agc): resolve and render a multisampled target through its sRGB twin format) makes the same assumption: it requires the storage view to be a new image (MSAA storage promotion kept the rendered image). On the same born-storable devices it now fails there onceStorageRemapis skipped. The second commit makes that check expect the same image when the target is born storable (same condition), and a new image everywhere else; the twin-view checks of that case still run on every device.Tested
This branch rebased onto
maina8bc4474c(2026-10-27); themainand first-commit-only arms were run onmain4297464b1, which has the sameMultisampleRetirement.cppandMultisampleTarget.cpp. Ubuntu 26.04, GCC 15.2, Release, same command and the three variables, layer 1.4.341, RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), 3 runs each:agc_driver_multisample_retirementmain(4297464b1)MSAA storage promotion did not retain its source image(StorageRemap)eb6f3f94e)MSAA storage promotion kept the rendered image(StorageTwin)StorageRemapskipped,StorageTwinruns0
VUID-in every run, no missing-layer message. Both devices runStorageTwin(both haveshaderStorageImageMultisample).The runs below are from before
StorageTwinexisted:Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Run asctest --test-dir build -R ^agc_driver_multisample_retirement -V -j1 --timeout 30withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(layer 1.4.341, Ubuntuvulkan-validationlayers1.4.341.0-1), onorigin/maind6eafa54dand with this change applied on the same checkout. Two devices on the same host, selected withVK_ICD_FILENAMES: NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8).agc_driver_multisample_retirementmainVUID-MSAA storage promotion did not retain its source image), 0VUID-VUID-StorageRemapskipped: "...born storable with no promotion to retire..."), 0VUID-No log reports
was not found but was requested by env var VK_INSTANCE_LAYERS;VK_LOADER_DEBUG=layerconfirms the validation layer is inserted at instance and device level on both devices. NoVUID-message onmainor with this change, so no newVUID-. Full logs are in the review thread.The earlier runs on
a6dcea927withANYPS5_NO_SHADER_CACHE=1gave the same pass/fail table (RTX 3070 2/2 pass both ways; lavapipe 3/3 fail onmain, 3/3 pass with this change).The driver log confirms the mechanism: NVIDIA reports a 2x2 largest sample-location grid at 4 samples (so
StorageRemapruns and the promotion allocates a new image), lavapipe reports 1x1 at 4 samples (so the target is born storable andStorageRemapis skipped).Apple M2 Max (macOS 27.2, x86-64 under Rosetta, on #8658
564e005acbbecausemaindoes not link on macOS), same command and the three variables, layer 1.4.363 from the LunarG SDK, MoltenVK 1.4.2 and MoltenVKmain+ SPIRV-Cross #2704: fails identically on the base and with this change (the device cannot write the multisampled color target's format as a storage image at its sample count), only the pre-existingVUID-VkDeviceCreateInfo-pProperties-04451(portability subset) on both, no newVUID-. MoltenVK has a 1x1 grid but noshaderStorageImageMultisample, so this change's condition is false andStorageRemapthrows; that is the case #8604 skips. Logs in the review thread.Not run: Windows, the full agc suite rebuild.
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