fix(agc): run the device startup probes as RDNA when a PS4 title has selected GCN shaders #20156
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20156"
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 Gag21 on 2026-11-14T18:30:09Z.
What
A PS4 title selects GCN shader decoding for the whole process (
ShaderRecompiler::SetGcnGuestShaders(true)) on its first Gnm submit. When the Vulkan device opens after that, its three startup probes fail: the f32 flush, f32 denormal preserve and f16 conversion probes are RDNA programs built intolibSceAgcDriver, and they were decoded as GCN. The device constructor throws and the title stops:0xd54b000eis word 10 ofMixedCodeinFloatFlushProbe.cpp, an RDNA VOP3 instruction.VulkanDevice's constructor now turns GCN decoding off for the three probes and restores the previous selection after them, also when a probe throws.agc_driver_gcn_device_startup_probesselects GCN first, then opens a device, and checks that the selection is still on afterwards.docs/dev/debt/libSceAgcDriver.mdrecords the remaining limit: the selection is process-wide, so a guest shader that another thread recompiles during the probes of a second device would be decoded as RDNA in that time.No shader, pipeline or draw path changes; only which decoder the three probe programs go through.
Tested
Windows 11 Pro 10.0.26300, i5-6600K, NVIDIA GeForce RTX 3070 (driver 621.01), WinLibs GCC 16.2.0, CMake 4.4.4, Ninja, Release,
BUILD_TESTING=ON, onmaina44e050e82.New test
agc_driver_gcn_device_startup_probes: passes on this branch. With only theVulkanDevice.cppchange reverted and the test kept, it fails with the message above.Related tests: the tests matching
^agc_driver_(gcn|float|f16|f32|device|two_device)include the float flush and f16 conversion probe tests, the GCN execution tests and the two-device tests.Validation layer comparison, same machine and GPU, Vulkan SDK 1.4.363.1 (
VK_LAYER_KHRONOS_validation), withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layerandctest --test-dir build -R "^agc_driver_(gcn|float|f16|f32|device|two_device)" -V, each side rebuilt from its own source:Insert instance layer "VK_LAYER_KHRONOS_validation"was not found but was requestedVUID-maina44e050e82The change adds no validation errors; neither log has any.
A title: a PS4 game dump (CUSA01709 01.02) converted with
relinker --windows. It needs local changes that are not in this PR to get this far (#19959 to unwrap, a relinker change equivalent to #17105, a stand-in for #18087, the exports of #17711 and #19990, a relaxed fixed-address check insceKernelMapDirectMemory, and a compute queue stand-in in place of #18546). With those, and without this change, it stops at device creation with the message above. With this change the device opens, the probes report ([float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ ...)), and the title goes on toAGC graphics: PS4 color target fast clear (CMASK) is not implemented.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --branchfailed closed (exit 2): it could not confirm overlap for open pull requests that conflict withmain. I compared the 43 of them that touchVulkanDevice.cppby their diffs; none changes the probes or the GCN selection (for #7642 and #9508, whose diffs are too large to fetch whole, by theirVulkanDevice.cpppatch from the API). The others share onlydocs/dev/debt/libSceAgcDriver.md.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-11-16T22:49:45Z.
Review: COMMENTED
Reviewed — no blocking findings
The startup probes are scoped to RDNA decoding with restoration on normal exit and exceptions, and the new test checks that GCN selection is restored.
What I ran
Reviewed head
951474295f5980af1730d161bf6ca6f287093920. I read the prepared description, commits, manifest, diff, the full added test, and the changed source ranges inVulkanDevice.cpp; repository files were read throughrepo_read.py. No tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The changed test registration/build configuration and other callers of the process-wide GCN selection were not inspected.
VulkanDevice.cppwas too large for the prepared files, so only lines 230–250 and 2770–2865 were read.files.jsonwas unavailable through the reader; the manifest lists three changed files, two included in the review bundle and one excluded as too large. Test results and reported title behavior were not independently verified.To get this to a good state
Nothing is required.