fix(agc): retain offchip LDS enable during shader fusion #6653
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6653"
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-16T01:51:25Z.
What
GS shader-half fusion rejects Cocoon (PPSA08766, bring-up #6651) when the front half requests
SPI_SHADER_PGM_RSRC2_GS.OC_LDS_ENand the back half does not:The observed resource words are front
0x70004, back0xab0020; the unmatched bit is0x40000. Bit 18 isOC_LDS_ENin AMD's GFX10 register definitions.Preserve this enable when either half requests it, yielding
0xaf0004for that pair. User SGPR allocation still comes from the front half, other state remains with the back half, and other unmatched hardware requirements still throw. The technical debt entry records that this merge is inferred from retaining the halves' requirements; console fusion output has not been measured.This is a later startup stop reached with graphics changes; unmodified main stops Cocoon earlier on geometry output assembly. This PR does not make Cocoon boot or claim a performance gain. The native sequence and full integration stack are recorded in #6651.
Tested
Arch Linux 7.2.9, GCC 16.2.1, Release, Ryzen 9 7950X, Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1.
Built
agc_shader_fusion_testson current main5d9dcc42dplus only this commit (522696d1c), with the pinned submodules.ctest -R '^agc_shader_fusion$' --output-on-failurepasses without skipping.Added all four combinations of front/back
OC_LDS_EN, checking the size query and fusion output, plus the exact Cocoon resource pair. Existing rejection of another unmatched hardware-state bit remains tested.Negative control on that same main-based tree: restoring only
MergeRsrc2to main's implementation makes the new test fail with the hardware-state refusal; restoring this change passes.Native Cocoon on the experimental stack in #6651: without this change, the size query aborts on the resource pair above. With this change, startup passes it and aborts at
VGT_SHADER_STAGES_EN=0x2135: combined tessellation and geometry is unsupported by the reference path. Still no visible menu or gameplay. Other graphics changes are needed to reach this call; their necessity was not ablated individually.Current-main integration recheck: main
2626e5ee7e57df6e952a93a997a8b9fc79d80c08plus refreshed #6801/#6639 reaches the fusion refusal. Adding only this PR's commit gives local integration943ab33635869df874f30110a8b4e3e44bed8400:agc_shader_fusion,agc_driver_meshandrequest_serializerall pass on RX 6650 XT / RADV Mesa 26.2.4, with Vulkan required and no skips. Native Cocoon then reaches the laterVGT_SHADER_STAGES_EN=0x2135combined tessellation/geometry refusal after 24.09 s, with a fresh writable cache and no input. The game PID is gone and the kernel setting restored. No gameplay/rendering/performance claim; this is an integration result, not a standalone-main title run.The device-backed fusion test verifies metadata/layout and registration; it does not establish rendered correctness of the title. Windows/macOS and other GPUs were not tested locally.
Contributor-reported Windows validation by Neithennn: head
522696d1cmerged onto mainf51724078, Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 driver 617.42, Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies,BUILD_TESTING=ON,ANYPS5_NO_SHADER_CACHE=1. Full build andagc_shader_fusionpass; fullctest -j8reports 1398/1398 for both this PR and unchanged main. No title run. These results were reported by the contributor, whose testing was AI-assisted with Claude Code; they were not reproduced locally.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T02:58:35Z.
Review: COMMENTED
Same result on NVIDIA and lavapipe.
Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Head522696d1cmerged intomain5d9dcc42d(clean merge),-j1 --timeout 30.ShaderFusion.cpprestored frommain):agc_shader_fusionfails on both devices withsceAgcGetFusedShaderSize_0080: front half requires hardware state the back half does not enable.agc_shader_fusionpasses 3/3 on the RTX 3070 and 3/3 on lavapipe, with no skip.GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T02:58:47Z.
Manually reviewed the comparisons the bot could not perform: #5877 at
28b726e18changes interpolant-mapping call-site evidence; #5889 atd6465ccffchanges the initialization ABI/debt; #6447 at1547b5dfconly removes the oldsceAgcUpdateInterpolantMapping_0100stub fromShaderFusion.cpp, alongside unrelated debt updates. None changesMergeRsrc2or implements the OC_LDS_EN propagation here.These are shared-file edits, not prerequisites of this fix.
Depends on: noneremains accurate. This branch is mergeable against current main5d9dcc42d; any later debt conflict will be resolved during rebase with the documented debt-split workflow.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-17T17:02:51Z.
Windows NVIDIA run, since the description lists RADV only.
Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_NO_SHADER_CACHE=1. Head522696d1cmerged onto mainf51724078; full build succeeds.agc_shader_fusion: passes.ctest -j 8: 1398/1398. Unchanged main on the same machine: 1398/1398.No title run.
AI-assisted: yes (runs done with Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T08:02:53Z.
Checked the diff against the description:
OC_LDS_EN(bit 18) is kept when either half requests it, user SGPRs still come from the front half, other unmatched state still throws. The new test covers all four front/back combinations plus the reported Cocoon pair (0xaf0004), and fails on main at the size query. The debt entry states the merge is inferred, not measured. Third-party NVIDIA/lavapipe and Windows runs match. Merging through the queue.