fix(shader): decode GFX10 scratch offsets as one dword #5426
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5426"
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 Prophet069 on 2026-10-13T19:27:53Z.
What
GFX10 scratch SV addresses contain one32-bit VGPR offset, not the VGPR pair used for ordinary FLAT addressing. VGPR255 was therefore incorrectly rejected. Decode SV/SS/ST address components independently and make the scratch IR consume the offset components; retain the FLAT/global VGPR-pair and unsupported-scalar checks. Source: LLVM FLATInstructions.td for the operand widths and SV/SS/ST pseudos, and GFX10 encoding for null/EXEC_HI sentinels. #1190 changes flat-aperture SPIR-V routing and does not modify these decoder/IR units.
Replaces the obsolete base of closed #2965, which was automatically closed for intake pause. Targeted current GitHub search found no other open PR implementing this exact export/decoder correction. Related #5005 is a scalar-aperture change, not the one-dword scratch decoder fix.
Tested
Windows 10 Pro 22H2 x64 (build 19045), MinGW GCC 15.2.0: fresh production decoder, IR, translation and control-flow sources compiled on this candidate; all 14 valid/invalid scratch/FLAT decoder and IR cases passed (0.06 s). The standalone test uses the existing Windows
.eh_frameto.ehframconfiguration and the freshly built libc import library. No Vulkan or PS5 hardware scratch-address result is claimed. The instructiondc304000 027d00ffwas originally captured from Death Stranding 2: On the Beach, PS5 title ID PPSA02015, in an earlier experimental integration. This is not a claim that this isolated PR renders or boots the game.Based on main
dacd78525e537a779682032c0ace7f7af120af05; candidatecc1dc3f1c6f88cd03665f933e0b7590e5717b0fe. No dumps, runtime packages, investigation reports or images are included. No speed improvement is claimed.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by KauaSantos702 on 2026-10-14T13:44:59Z.
NVIDIA run at this head (
cc1dc3f1c), adding a vendor to the AMD results in the body: noagc_*test fails.BUILD_TESTING=ONctest -R '^agc_' -j2: 484 tests, 483 passed, 0 failed, 1 skipped. The skipped test isagc_driver_stencil_ref_export, because the device lacksVK_EXT_shader_stencil_export; it is also skipped onmain.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T19:27:33Z.
Review: DISMISSED
Checked the decoder/IR change on a Linux build merged onto current
main:agc_flat_scratchpasses and fails without the fix, so the logic looks right. Two things before it can merge:mainindocs/dev/debt/shader.md(TechnicalDebt adjacency) and "Allow edits from maintainers" is off, so we can't rebase it for you. Please rebase on currentmain, and put the new### GFX10 scratch address operandsentry away from the end of the file, where other PRs append.core/libs/prx/libSceAgcDriver/tests/FlatScratch.cppis not formatted like the other tests (no spaces around operators, several statements per line,Scratch/Rejecthelpers on one line); please run clang-format on it and drop the doubled blank line before the new block inlibSceAgcDriver/CMakeLists.txt(line 2241-2242).Not covered: the real-hardware result of a scratch access with a VGPR offset; the TechnicalDebt entry already says so.
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-15T06:30:08Z.
A title reaches this: Death Stranding 2 (PPSA02015, 01.015.000) on Linux. It only gets this far with a local fix to the AMM address range (on current
mainit stops at 1 s on that, PR to follow), and then it registers a shader within its spill code (word 0x553 of a 0xd70-word program, well before
s_endpgm; LLVM gfx1030 decodes it the same). Without this PR it stops at 39.5 s withFLAT address register range overflow. Withcc1dc3f1ccherry-picked on top, that throw is gone and it runs to 45 s, where it stops on something unrelated.agc_flat_scratchpasses in that build.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T15:22:49Z.
@Prophet069 a friendly nudge on this one. The maintainer's 14 Oct review says the logic looks right (
agc_flat_scratchpasses with the fix and fails without it). What's left is a rebase onto currentmain, where the only conflict is the adjacent entry in the shader debt doc, and a clang-format pass. Once those are pushed, the change request can be re-reviewed and the PR can go through CI.Imported from boykopovar/AnyPS5. Originally posted by Prophet069 on 2026-10-20T17:56:48Z.
@oneandonlydean thank you for the reminder. My ai setup doesnt run currently (swtching to qwen from codex because of slow progression and fast plan usage. Can you rebase it for me? I alllowed edits to be made. Sorry i'm not that knowledgeble with all the github stuff. Just wanted to help without understanding much of it.