fix(agc): transition resident attachment subresources #6934
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6934"
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 JJenkx on 2026-10-16T20:01:20Z.
What
Immediate rendering to a resident mip or array-layer view transitions mip 0/layer 0 instead of the attachment subresource.
APS5_SYNC_DRAWS=1and target dumping can therefore issueVUID-vkCmdBeginRendering-pRenderingInfo-09592: the rendered subresource remainsGENERALwhile the attachment declaresCOLOR_ATTACHMENT_OPTIMAL.Pass the selected mip and array-layer range to both immediate resident-image barriers. A 3D image still uses its single Vulkan array layer; its selected depth slices belong to that mip. Transient-image callers keep their existing default range. Only
Draw.cppchanges, four lines replaced.Tested
Current-main-only head
1b70ce290fonea4cc112a0. Arch Linux 7.2.9-arch1-1, GCC 16.2.1 Release, Ryzen 9 7950X; RX 6650 XT / RADV Mesa 26.2.4-arch1.1 and lavapipe Mesa 26.2.4 / LLVM 23.1.1. Khronos validation layer 1.4.363, standard core checks; no explicit synchronization/GPU-assisted validation. Vulkan required, shader disk cache disabled,APS5_SYNC_DRAWS=1.libsand the three existing execution test binaries build.agc_driver_array_layer_target,agc_driver_packed_mip_tail_target,agc_driver_layered_volume_draw: 3/3 pass on RADV and 3/3 on lavapipe, zero skips and zero validation errors/VUIDs. The volume case verifies that array-layer selection is not confused with 3D depth slices; its mesh subcase validates shaders only.Draw.cppwith exact current-main source, keep the fixtures unchanged and rebuild. All three pixel tests still pass, but the array-target fixture reports two 09592 validation errors per driver, both on array layer 1 remaining inGENERAL. Restore/rebuild the fix: 3/3 pass with zero errors on both drivers again. The functional tests alone do not detect the API error; the validation logs do.c01f24339a1b(mainb260d8d792plus #6913/#862/#6781 and diagnostic readbacks): the preceding target-dump run reports ten capped instances of the same VUID on mip 1. With this fix, the repeated target-dump run exits 0 after 97.64 s with zero validation errors/VUIDs and restored settings. This integration is not isolated current-main title validation. Very dark 3D rendering remains unchanged; no visual or FPS improvement is claimed. Bring-up and exact source.1b70ce290f3a2ef4d751c1f228540a589d3c1ff9commit and declares it as a prerequisite. Their compositionb605c6887passes extra-mip, image-level, array-target and packed-tail fixtures 3/3 on RTX 5080 / driver 32.0.16.1062 and Radeon Graphics / driver 32.0.21036.18, Windows 11 Enterprise 26200, with Vulkan required, shader cache disabled,APS5_SYNC_DRAWS=1and Khronos core 1.4.363: zero validation errors/warnings for those four groups. They also report Linux Mesa 25.2.8 llvmpipe 3/3 passes without explicitly enabled core validation. The layered-volume fixture passes 3/3 but emits tenWARNING-VkImageSubresourceRange-layerCount-compatibilitywarnings per physical run, including transfer barriers; these are not attributed solely to this change. These are attributed composition results, not standalone tests of this unchanged PR head.APS5_SYNC_DRAWS=1. Onmacos-portatb7eb6b6bplus ImportWatched, they applied this PR with the layer-range arguments adapted to one layer because that port lacksColorTarget::layers. The array-target fixture passes pixel checks on both trees, but two layer-1 layout errors (VUID-vkCmdDraw-None-09600) on the unchanged port become zero with the adapted change. Packed-tail has no layout errors on either tree, so this does not validate the mip fix. Both trees retain the same twelve unrelated multisample-storage image-creation errors (00968). Their broader suite reports 14/433 failures, including a cross-workgroup case reproduced 5/5 on the unchanged port. This is attributed adapted-port evidence, not a clean-main macOS run or zero-error full suite.origin/mainand whitespace pass. Required overlap check finds no confirmed overlap; its 22 conflicted shared-file heads were inspected at this helper and the resident barrier calls, with no selected-subresource implementation found. This is a scoped review, not a claim those whole branches combine cleanly.Sanitized report, negative/restored validation logs and patch, assets prefixed
resident-subresourceorsubresource-isolated. No new fixture, driver dependency or diagnostic code is included here. Standalone Windows/NVIDIA/macOS and full hosted builds have not been run by us; the external composition coverage above does not replace them. Full platform jobs require maintainer dispatch.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-16T20:10:53Z.
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.
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppImported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T10:54:28Z.
Thanks for the resident-subresource correction. #7085 builds its extra guest-mip backing on your exact
1b70ce290f3a2ef4d751c1f228540a589d3c1ff9commit, preserving authorship and declaring #6934 as a prerequisite. Our added Draw work maps the selected guest mip to its physical image/mip through your existing range-argument interface.Composition
b605c6887passes the extra-mip, image-level, array-target and packed-tail fixtures 3/3 on RTX5080/driver32.0.16.1062 and Radeon Graphics/driver32.0.21036.18, Windows11 Enterprise26200, withAPS5_SYNC_DRAWS=1, Vulkan required, shader cache disabled and Khronos core1.4.363: zero validation errors/warnings. The corresponding Linux Mesa25.2.8 llvmpipe runs pass3/3; its core layer was not explicitly enabled. These are composition results, not tests of your unchanged head.One additional observation:
agc_driver_layered_volume_drawpasses3/3 on each device and has zero physical core errors, but each physical run logs tenWARNING-VkImageSubresourceRange-layerCount-compatibilitywarnings. The layer says 3D images withVK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BITand maintenance9 disabled currently interpret layerCount=1 as all depth slices;VK_REMAINING_ARRAY_LAYERSwould keep that interpretation when maintenance9 is enabled. The count includes texture-transfer barriers as well as immediate-draw coverage, so it is not attributed solely to your patch. I retained the behavior and disclosed the warning in #7085 for a separately scoped follow-up.AI-assisted: yes (Codex); author responsible.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T15:14:42Z.
Apple GPU / MoltenVK run with the Khronos validation layer, since macOS was not run.
Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head
1b70ce290. Method: macos-port @ b7eb6b6b + ImportWatched + PR diff, not main. The port has noColorTarget::layers, so both new range arguments use one layer (what the port renders); otherwise the fourDraw.cpplines are the same. Driver: MoltenVK 1.4.2 (Vulkan SDK 1.4.363),VK_LAYER_KHRONOS_validation1.4.363,APS5_SYNC_DRAWS=1,ANYPS5_NO_SHADER_CACHE=1.agc_driver_array_layer_targetagc_driver_packed_mip_tail_targetDraw.cppunchangedVUID-vkCmdDraw-None-09600atvkQueueSubmit, not as 09592, but it is the same subresource:arrayLayer = 1expected inCOLOR_ATTACHMENT_OPTIMALwhile it is stillGENERAL, and then the reverse on the way back. Both go away with the PR.VUID-VkImageCreateInfo-usage-00968errors: a 4-sample image created with storage usage whileshaderStorageImageMultisampleis off (MoltenVK doesn't expose it). They are unrelated to this PR.Full
^agcsuite with the PR (SDK driver,-j1 --timeout 30, flip/display/lds_atomics64 excluded): 14 failures out of 433. These are the 13 known port-baseline failures plusagc_driver_cross_workgroup_flag, which also fails on the unchanged port on this machine today (intermittently, in streaks), so it isn't caused by this PR.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 adriadam10 on 2026-10-19T19:18:13Z.
Checked the diff:
imageBarriertakes a subresource range (default unchanged for the transient callers) and both resident-image barriers inDrawnow usebinding.color.mip/arraySlice/layers, the same argumentsAttachmentViewis created with at line 2214; 3D images keep their single array layer. The 09592 negative/restored validation logs and the Windows (@Amoenus) and MoltenVK (@jotitadev) runs cover what the pixel fixtures can't; merged.