Repository navigation
fix(libSceAgcDriver): decode PS4 tiled scanouts in their own layout on the CPU path - #9673
Conversation
|
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.
|
|
Reviewed; the CPU-path drop-in is exact. For the linear case One process note (from the stack): this PR's conflict surface is entirely #9431's — its own two topic files are untouched on main since the merge-base — so the rebase cost arrives with the stack, not with this commit. |
MarcZX10
left a comment
There was a problem hiding this comment.
The isolated change routes the 4-byte decode through the existing texelOffset path, and the new linear_display_buffer case exercises a full 1920x1024 GCN scanout mapping. Current-main conventions and git diff --check pass. The PR is currently CONFLICTING with main; its declared dependency #9431 is also conflicting.
Because this changes the AGC driver, CONTRIBUTING requires paired focused tests on main and the change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1, using ctest -V on the same machine/GPU. Please confirm the requested layer loaded, compare the logs for newly introduced VUID- errors, and record the GPU on the checklist. The reported Windows/NVIDIA test and two title runs are useful but do not include the required validation-layer comparison.
The description reports the CPU fallback as broken for Gang Beasts (CUSA04865) and Knowledge is Power: Decades (CUSA12435), but the checklist says Unblocks: none. Please reconcile that checklist with the title evidence and link each applicable Game bring-up discussion; if a discussion is missing, follow the repository's title tracking rule. The report also measures 116 ms for a 1080p decode on this path; please keep that latency visible in the technical-debt/known-limit description and confirm whether it is confined to the first flip or can recur with the debug knobs.
|
Thanks. Two of the three points are addressed on the branch:
The conflict is #9431's ( AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
…n the CPU path DecodeDisplayBuffer's 4-byte loop computed the tiled offset itself and only knew the linear and PS5 64 KiB layouts, so a PS4 Display2D scanout (DisplayTilingGcn) was read with the PS5 formula and came out scrambled. The half-float loop and DisplayBufferOffset already go through texelOffset, which handles all three; the 4-byte loop now does too. The path only runs when a flip has no pending image to blit (the first flip, or with APS5_STORE_AT_LABEL / APS5_EAGER_WRITEBACK set). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at it costs ReadDisplayBuffer decodes a DisplayTilingGcn scanout texel by texel, about 116 ms for 1920x1080. It runs for a linear buffer at every flip, and for a tiled one only for a frame dump or screenshot read from guest memory, which is the case when no resident image is pending at the flip: the first flip, or every flip while APS5_STORE_AT_LABEL or APS5_EAGER_WRITEBACK writes results back first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Thanks for updating the checklist with both title discussions and recording the repeated 116 ms decode cost, and for adding the paired validation-layer results. Those address the title-link, known-cost and validation-evidence points from the earlier review. The remaining blocker is the stack: #9431 still conflicts with current main, and this PR is based on its earlier head. The reported before/after runs use main 7e2ba73, while current main has advanced. Please rebase after #9431 is refreshed and rerun the focused display-buffer checks plus the affected title path against the resulting current-main merge base; then update the bring-up discussions if the furthest point or blocker changes. The host-report results are author-reported; I did not run a local build because no build tree is configured and the filesystem is full.
1d3bed6 to
0eb1dce
Compare
|
Rebased onto #9431's new head ( AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
Gang Beasts (CUSA04865) on the current stack: The six pull requests alone do not carry the title over For this PR: the CPU decode ran once, on the first flip ( AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
The conflict is in the base: #9431 (and #9432 over it) conflicts with current AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
Landing-order note, and it matters for correctness: @savvaniss's #9891 includes 822a9ea ( AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
Thanks, @oneandonlydean, for checking the 822a9ea interaction. This PR is ready on its side: as soon as Get-fix has rebased #9431, I will bring it onto the new head first and rerun the focused display-buffer tests, the paired validation and the checks there. AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
adriadam10
left a comment
There was a problem hiding this comment.
Checked the two commits that are this PR's own (68543e4, 0eb1dce). The change itself is right: texelOffset(buffer, x, y, 4u) covers linear, 64 KiB and DisplayTilingGcn, and GcnDisplay pins every pixel of a 1920x1024 GCN buffer through DisplayBufferOffset, so it fails with the old 64 KiB formula.
docs/dev/debt/libSceVideoOut.md:26says "registers asDisplayTilingGcn(next entry)", but there is no next entry in that file. Point it at the "PS4 (GCN) tiling" entry indocs/dev/debt/libSceAgcDriver.mdinstead.- The branch conflicts with
mainthrough its base #9431 (GuestTextureResource.hpp). Please rebase onto #9431's refreshed head and rerunlinear_display_buffer; it can merge once #9431 and #9672 have landed.
…entry The sceVideoOutRegisterBuffers entry referred to a "next entry" for the DisplayTilingGcn layout that is not in this file; it now names the PS4 (GCN) tiling entry in libSceAgcDriver.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both references to libSceAgcDriver.md now share one link, which brings the entry back under 1000 characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, @adriadam10. Fixed the reference in 3840ec6 (with d2f3810): the The rebase waits for #9431's refreshed head (still 26d651d); I will bring this PR onto it first, rerun AI-assisted: yes (Claude Code) |
…cn-scanout-decode # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/include/GuestTextureResource.hpp # core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp # core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp # core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp # docs/dev/debt/libSceVideoOut.md
…cn-scanout-decode
|
#9431 is merged, so this branch now has current @adriadam10: the On the merge head: @MarcZX10: the title path (Gang Beasts and KiP with AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 643057ce944c6a8c0d8d74eb278b376dd0010295. Current main (f7e84c4cf1) is an ancestor; check_main_sync reports a clean merge with no files changed on both sides. The remaining four-file diff routes the 4-byte decode through texelOffset, adds a full 1920x1024 GCN-layout round-trip test, and updates the two relevant debt descriptions. Current-main conventions and git diff --check pass. The PR reports paired validation-layer runs on the same RTX 2080/Windows setup: the layer was loaded on both trees, 0 VUID- IDs on either, plus three focused tests passing on the branch. I did not independently run the GPU tests locally. The prior blockers about #9431/current-main integration, title links, decode-cost documentation, and validation evidence are addressed; approving this head.
✅ NVIDIA GPU test: passedPR head
Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 390 tests)Skipped (40)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Static review plus an independent Linux/AMD run on both trees per the repo AGENTS AGC/display protocol (CachyOS, kernel 7.2.10, GCC 16.2.1, Ninja 1.13.2, Release, What I checked (static)
Focused paired run (VVL env)
Comparing logs, no new validation errors from this change. Notes
|
…n the CPU path DecodeDisplayBuffer's 4-byte loop only knew the linear and PS5 64 KiB layouts, so a DisplayTilingGcn buffer came out scrambled. It now goes through texelOffset, as the half-float loop and DisplayBufferOffset do. This is the same change as boykopovar#9673, carried here because a non-resident PS4 flip now reaches this decode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cn-scanout-decode # Conflicts: # docs/dev/debt/libSceAgcDriver.md
|
On the merge head:
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (5 IDs in 484 tests)Skipped (45)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@adriadam10, could you take another look when you have a moment? Your changes-requested from 2026-10-24 is still the active one on this PR. Both of its points are done on the current head (868b0f8):
AI-assisted: yes (Claude Code) |
…cn-scanout-decode # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/include/GuestTextureResource.hpp # core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp # core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp # docs/dev/debt/libSceAgcDriver.md # docs/dev/debt/libSceVideoOut.md
|
The conflicts were all in files from the old stack, and those now match On the merge head:
The description is updated. AI-assisted: yes (Claude Code) |
|
Both points of the earlier review are addressed: the |
What
DecodeDisplayBuffer's 4-byte loop worked out the tiled offset inline and only knew the linear (tilingMode == 1) and PS5 64 KiB layouts. A PS4 Display2D scanout (DisplayTilingGcn) fell into the 64 KiB branch and came out scrambled. The half-float loop andDisplayBufferOffsetalready go throughtexelOffset, which handles all three layouts, so the 4-byte loop now calls it too. For the linear and 64 KiB casestexelOffset(buffer, x, y, 4)gives the same offsets as the removed code.The CPU decode only runs when a flip has no pending image to blit: the first flip, or with
APS5_STORE_AT_LABEL=1/APS5_EAGER_WRITEBACK=1. That is why the default path looks fine and the knobs showed a broken image. The Display2D retile of the render target was correct; only this read was wrong.Note:
texelOffsetcomputes the GCN address of every texel one by one, so a 1080p CPU decode takes about 116 ms, against 9.4 ms for the old (wrong) 64 KiB formula. The half-float loop pays the same cost today. I left it as it is because this path only runs on the first flip or with the debug knobs. A new debt entry, "CPU scanout decode", records the cost and when the decode runs: for a linear buffer at every flip; for a tiled one only for a frame dump or screenshot read from guest memory, which is the case when no resident image is pending, that is the first flip, or every flip whileAPS5_STORE_AT_LABELorAPS5_EAGER_WRITEBACKwrites the results back before the flip. ThesceVideoOutRegisterBuffersentry indocs/dev/debt/libSceVideoOut.mdstill said that tiled PS4 buffers throw; it now points at the tiled-buffer entry and at the decode entry.mainnow carries theDisplayBuffer.cppchange itself (574321b, which came in with #9432), so on this branch the PR's diff againstmainis theGcnDisplaytest inLinearDisplayBuffer.cppand the two debt-entry updates.This moves Get-fix#18 (opened against
ps4/limbo-gpu) tomain, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has currentmainmerged in.Landing order: #9891 (822a9ea) sends every GCN-tiled flip without a resident image through
ReadDisplayBuffer, i.e. through the decode this PR fixes, so this PR should land before #9891 or with it; the "CPU scanout decode" debt entry then gains one sentence for that path.Tested
Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with
BUILD_TESTING=ON, on this branch with currentmain(f79ea3f) merged in; #9431 is merged, so the branch's diff againstmainis this PR's own change:GcnDisplaycase inlinear_display_buffer: it fills a 1920x1024DisplayTilingGcnbuffer throughDisplayBufferOffsetand checks that every decoded pixel lands at its linear position. It passes; withDisplayBuffer.cppreverted to the base it fails.linear_display_buffer,agc_display_buffer_dccandvideo_out_hdr_presentpass, three runs each.APS5_STORE_AT_LABEL=1: before, the frames were scrambled; now the title screen, level0, level11 and the KiP intro and tutorial screens render correctly.tools/check_conventions.py --base main(f79ea3f) with this title and description: no findings.mainf79ea3f (100% of the 25 tests that exist there passed, the depth, display-buffer and graphics tests of this stack) and this branch with thatmainmerged in (100% tests passed out of 3:linear_display_buffer,agc_display_buffer_dcc,video_out_hdr_present) withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andVK_LOADER_DEBUG=warn,error,ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader'sadding layers "VK_LAYER_KHRONOS_validation"line (62 and 2 times) and neither reportswas not found but was requested by env var VK_INSTANCE_LAYERS;VUID-ids onmain: 0, on this branch: 0, new on this branch: 0.Checklist
main; no other open PR implements the same functions (currentmainf79ea3f merged in; feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431 is merged; searched open boykopovar/AnyPS5 PRs for scanout andDecodeDisplayBufferon 2026-10-22)NotImplemented_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)