feat(agc): present DCC display buffers whose keys are uncompressed or fast-cleared #648
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/648"
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 Celegans12 on 2026-10-05T10:55:06Z.
What
sceVideoOutRegisterBuffers2throws "VideoOut: DCC presentation is not implemented" for DCC-compressed (category 1) buffers, which PPSA26344 registers.dcc_controlmay only use the CB_DCC_CONTROL block layout bits 0x10026c. Buffers registered without DCC take the old path unchanged.CurrentDccKeysreads the keys behind their recorded writers, one byte per 256 bytes as in the driver's DCC model, not in the console's metadata layout.StorageImageServesKeys, #466) and its own key fill is not the current code; it is refreshed first when its texels or keys moved.dcc_controlbits outside 0x10026c; category 0 with DCC fields; an unknown category; DCC on a linear buffer; missing metadata.LayoutFormaps the format in #764.GuestMemory::GpuMutex; a pending key fill or the driver's own key store is read without a wait (#458).dcc_controlfrom 0x1616450, which produces only 0x24, 0x48, 0x208 and 0x100024, and a clear color of 0. The key codes are those of the driver's DCC model (#132, #163, #466), which match Mesa's gfx10 codes.dcc_controland the clear color, and the key states this path presents.VulkanDevice.cppand the AgcDriverCMakeLists.txt; both files merge cleanly.sceVideoOutRegisterBuffers2line, so whichever lands second needs a one-line rebase.Tested
mainbc24783e: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)agc_display_buffer_dcc(ctest): the presented pixel of every clear code on B8G8R8A8, of the register clear color on all four display formats, of 0001 on R8G8B8A8 and of 0001 and 1110 on A2B10G10R10, and a row for each key state and buffer thatDisplayBufferClearPixelorDisplayBufferSizerejects; it does not build onmain.video_out_flip_tests decode(not part of ctest): accepted and rejecteddcc_control, tiling, metadata and category values.video_out_flip_tests dcc(needs a GPU and a display, not part of ctest, as in #417): flips with keys 0x00, 0xff, 0x20 and 0xc0; withAPS5_DUMP_FRAMES=4every frame holds exactly the clear value or the stored texels.mainthis throws). On currentmainwith our other open pull requests the title runs on to an unrelated shader stop before its first flip, so the presentation of its DCC buffers is not exercised yet.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-05T18:02:51Z.
Tested with PPSA12544 (Hollow Knight: Silksong, Unity) on Windows 11, Radeon RX 9070 XT, merged onto
maintogether with the title's other startup fixes (#698, #699, #700, #702, #705, #709, #710).Without this PR the title stops at
VideoOut: DCC presentation is not implementedwhen it registers its display buffers. With it, registration succeeds and the title continues (Vulkan device and swapchain already created, then save data setup,UnitySubsystems,globalgamemanagers.assets,unity default resources). The title stops later for unrelated reasons before its first flip, so presentation of the DCC buffers itself is not exercised yet. Bring-up notes: #726.(Report written with AI assistance.)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T19:45:35Z.
Thanks, the presentation part reads well to me. Only category 1 buffers carry the DCC fields, so uncompressed buffers keep the old path. A single clear code is presented as a clear of the scaler's source image, and the clear goes through the same 8-bit conversion and channel order as the detiled path. Mixed keys, and register-clear keys over a pending image, still throw, and that seems the right call.
On your offer to split out the
LayoutForchange: yes please, if you don't mind. AddingVK_FORMAT_A2R10G10B10_UNORM_PACK32changes the draw path for every title. Alternate-swap 2_10_10_10 DCC targets under clear keys now get the clear value instead of their stored texels, andclearTexelno longer throws for them. That part needs its own check on PPSA21564, while the DCC presentation itself doesn't change anything for it: its display buffers are category 0, so withdccAddress0 the flip path is the same as on main. With the split, this PR can go in after #647 without waiting for that check.DccAlphaOnMsbdoesn't change with the new case (it already defaulted to 4 channels), so the split shouldn't need any other edits.A small note: this conflicts with #709 in
TechnicalDebt.mdonly, so whichever lands second needs a one-line rebase.Locally (Linux, GCC, NVIDIA), merged on #647:
agc_display_buffer_dccpasses, also 20 times in a row (it uses the newDisplayBufferClearPixel, so it can't build on main), andvideo_out_flip_tests decodepasses.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T21:03:18Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL31Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-05T22:01:02Z.
Thanks. Split out as #764: the
LayoutForcase forVK_FORMAT_A2R10G10B10_UNORM_PACK32, alone onmain. Itsagc_driver_graphicsrows run the eliminate pass andFillDccClear(the call a draw into a copied target makes) for both swaps of COLOR_2_10_10_10, and fail onmainat the alternate-swap 0001 row.This PR is now one commit on
mainbc24783e, without that line:A2R10G10B10 1111row ofagc_display_buffer_dccmoved out with it. On this PR alone, a blue-low 10-bit display buffer under 0001, 1110 or 1111 keys throws, and the message now says the display format has to encode the clear code. 0000 and the register clear still present, because neither goes throughLayoutFor.video_out_flip_tests decodeanddcc(RTX 3080 Laptop) pass.Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-05T22:24:03Z.
More data from PPSA12544 (Hollow Knight: Silksong), now that it renders (bring-up: #726). With this PR the title gets to its first flips and then stops at:
The display buffers are 1920x1080 (padded to 1920x1152, so
DisplayBufferSizecovers 34560 keys). A histogram of the keysDisplayKeysclassifies:0xff(uncompressed): 335520x00(clear 0000): 1008So every non-uncompressed key sits past the first 32400 keys, in the last 128-row tile row, which holds visible rows 1024..1079 and padding rows 1080..1151. A pending resident
StorageTextureexists for the buffer (the title writes it from a compute pass).As a local experiment I classified only the first
width * height * 4bytes' keys (std::min(bytes, width * height * 4)inDisplayKeys). The keys are then uniformly uncompressed, the resident image is presented and the title runs at ~60 fps for minutes. Correction: I had not checked the output, and every presented frame was black. The black frames came from a separate rejection ofPA_SC_MODE_CNTL_1bit 17 (#840). With that fixed, the logo, notices and title menu render correctly through this path. That prefix is only an approximation of "blocks that hold visible pixels" under the 64 KiB tiling, so I am not proposing it as is; a version that maps each key to its tile rows and ignores blocks entirely belowheightwould be the general form. Happy to test any variant against this title.(Report written with AI assistance.)
Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-05T22:36:56Z.
Thanks, that histogram pins it down. I'll do the general form as a separate pull request stacked on this one, so this PR doesn't wait for it:
widthxheightare classified.I'll link it here once it passes; a run against PPSA12544 would be very welcome.
Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-06T00:20:11Z.
@merwie the general form is up as #788, on current
main:If you can run PPSA12544 on it, the result would be a useful data point for that PR.