Repository navigation
fix(libSceAgc): return the console's register-defaults table and type pairs - #6270
Conversation
… pairs
The defaults root exposed the compact 12-byte type entries, whose second
word also packs each block's register count and stride above bit 10.
Titles read the type table as 8-byte {key, index << 2 | bank} pairs, so
PS5 FSR4 Showcase (PPSA99011) found the MRT0 key at index 529482 and
refused to build its compose pass. Build the pairs once per table and
check that every index lies inside its bank.
…cGetRegisterDefaults The legacy call takes no version and answered with the version 0 table. On a console it returns the running system software's table: 128 keyed entries over 79 context blocks on 10.x and 137 over 84 on 12.02 and 13.x, as ps5-vulkan measured and relies on. Version 0 holds 150 entries and its MRT0 block starts at 0x318 followed by 0x319, so PPSA99011 refused it even with the types fixed. Return the version 13 table, which is the 137-entry one.
… does Reads the root at its byte offsets, walks the type table as key and bank-index pairs and checks that the MRT0 key leads to the sixteen colour-target registers: block 78 of the table sceAgcGetRegisterDefaults returns, block 73 of version 10, and a valid block in every version from 4. Fails on the compact entries and on the version 0 legacy table.
|
Windows build and tests, for "Windows and macOS were not built here". Windows 11 (26200), RTX 3060 Laptop GPU (NVIDIA 617.42), WinLibs GCC 15.2.0 r7 (UCRT), Release,
Not run: PPSA99011, macOS. AI-assisted: yes (Claude Code) |
|
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.
|
|
Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head #5648 has since been merged as PS5 FSR4 Showcase (PPSA99011, 01.000.010). The "before" side is the same tree with only the two
So on NVIDIA I can't reproduce the Tests
Review notes
Verdict: build, tests and conventions are confirmed on NVIDIA/Windows, and no regression found. Not confirmed: the PPSA99011 compose fix. On this GPU, with and without the PR, the title stops earlier at Written with Claude Code assistance. |
|
AMD confirmation: with this PR, PS5 FSR4 Showcase gets past Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release.
The run before the The stop in chapter 2 is pipeline build time again, as in #6118. Chapter 2 dispatches programs the earlier chapters don't, and one of them wasn't cached yet: @screamm, on getting past AI-assisted: yes (Claude Code). |
|
@screamm on your two points:
|
|
Regression report for PPSA34063 (NHL 27, update 01.003.001) on Windows. I'm not claiming a cause in this PR's code; I'm reporting what changes when it is reverted and asking one question. Symptom. With this PR in, the title stops about 22 s after start, before it presents a frame, with: The message is the What I compared (Windows 11, MinGW-w64 GCC 15.2, RTX 3070, driver 617.42; same relinked executable, game files and
So reverting this PR is what removes the stop on this machine. I have not narrowed it to one of the two commits (the table type pairs, or Question. Does the console's version 13 register-defaults table contain entries a title turns into AI-assisted: yes. |
|
Since this PR, PPSA15304 aborts about 10 s after start: The message comes from Ubuntu 24.04, kernel 7.0.0, NVIDIA GeForce RTX 5080, driver 595.99.02, Release build. AI-assisted: yes |
|
@YossiYad since this merged, Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) stops before its first frame: The failing packet is a context register list: opcode 0x9f, pairs mode ( I narrowed it down on my integration build (
So this title appears to read the type table in the compact 12-byte form, while PPSA99011 reads pairs. Maybe the layout depends on the SDK the title was built with. I have not checked what the console's library hands out per SDK version. Happy to test a candidate fix on this title. Linux, RTX 4070 Ti SUPER, NVIDIA 615.78.08. AI-assisted: yes |
|
@YossiYad another regression from this merge, a different symptom from the indirect-register sentinel above, on a free catalog title anyone can run: Middle Ages Ping Pong (PPSA28319, a Unity homebrew from the homebrew catalog). Windows 11, RTX 3080, WinLibs GCC 15.2, Release.
Like the NHL 27 report, this isn't narrowed to one of the two changes yet: the AI-assisted: yes |
|
Narrowed the Middle Ages Ping Pong crash to the
So with this title, Unity reads Could the indirect register sentinel reports above have the same cause? A guest stepping through the pairs with a 12-byte stride would read keys from the wrong offsets. I haven't checked those titles, so I can't say. |
|
Correction to my two comments above: they were tested on |
What
PS5 FSR4 Showcase (PPSA99011, catalog 01.000.010) with #5648 stops at its first compose pass, 11 to 15 ms after chapter 0 starts:
No submission reaches the queue for it. The title's Vulkan driver (ps5-vulkan at
4bb0c8b) logs over the network, so I caught its lines on the guestvsnprintfwith gdb:Line 1030 of
native/graphics_queue_ps5.cisps5vk_color_runtime_defaults(defaults, sceAgcGetRegisterDefaults()).color_runtime_defaults.hlooks up the MRT0 colour-target block by its key0x38e92c91and refuses the table. There are two reasons:+0x30) held the compact 12-byte entries. Their second word also packs the block's register count and stride above bit 10 (0x00204138for MRT0 in the 137-entry table). The driver, like the other homebrew that share itsps5_agc_registers.h, reads 8-byte{key, index << 2 | bank}pairs. So it read MRT0 at index 529482.sceAgcGetRegisterDefaultsreturned the version 0 table. ps5-vulkan measured the console returning the running system software's table: 128 entries over 79 context blocks on 10.x, 137 over 84 on 12.02 and 13.x. The version 0 table has 150 entries, and its MRT0 block has0x319where the colour target has0x31b, so the driver refuses it even with the pairs fixed.Changes:
GetRegisterDefaultsbuilds the type table once per table as{key, entry & 0x3ff}pairs and checks that each index lies inside its bank.sceAgcGetRegisterDefaultsreturns the version 13 public table, which is the 137-entry one.sceAgcGetRegisterDefaults2(version)is unchanged.guest_shader_linknow expects that table (488 context registers instead of 523).agc_commandsandagc_initialization: reads the root at its byte offsets, walks the pairs and follows the MRT0 key to the sixteen colour-target registers. It expects block 78 forsceAgcGetRegisterDefaultsand block 73 for version 10, and a valid block in every version from 4.Title. PPSA99011 on
main+ #5648:stage=composein every run.stage=fsr4 after_ms=6149on its new pipelines. That is the build time described in AGC: PS5 FSR4 Showcase (PPSA99011) gives up in its first FSR4 pass while the queue worker builds 130k-800k-word compute pipelines (up to 66 s each on AMD) #6118.Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), RX 7700 XT (RADV), based onmaind92a8dad3:ctest: 1199 of 1222 pass and 20 are skipped (display tests).application_heap_lazyandagc_driver_tessellationsegfault, andagc_host_import_sparsefails, on unchangedmainhere too (test(agc): drop a shared range's backing when the range goes away #5759 fixes the last one).agc_commandsandagc_initializationfail on the new test with the compact entries put back ("MRT0 defaults key is missing, repeated or outside the context blocks"), and with the legacy call on version 0 ("legacy register defaults are not the newest public table").main4808d9c20+ fix(libc): fail stream calls on a stream that a failed freopen closed #5632 + fix(shader): accept buffer resource tuples ending in VCC #5648, hidden display, no controller. Catalog sweep of 67 titles (25 s each) against the same tree without this PR: no title that ran before stops or drops in FPS, and PPSA99011 now runs. No other title in the set contains the MRT0 key except a Unity title that does not start here.tools/check_conventions.py --base upstream/mainpasses, andtools/pr_overlap.pyreports no overlap. feat(libSceAgc): implement sceAgcGetDefaultCxStateFlat #5845 also edits bothRegisterDefaults.cppfiles andtests/Commands.cpp, addingsceAgcGetDefaultCxStateFlat, a separate function. Windows and macOS were not built here.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository