perf(agc): present resident displays without the 4K convert chain #5311
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5311"
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 oneandonlydean on 2026-10-13T16:55:40Z.
What
A resident display buffer that can't be blitted as-is (10-bit, 8-bit in the other channel order, or an sRGB type) went through four full-resolution steps plus a full clear of the swapchain image:
vkCmdCopyImageToBuffer;vkCmdCopyBufferToImageinto the scaler source;The scaler source image and the color transfer's buffers are single objects, so before recording that chain each present also waited for every earlier present still in flight (
RetirePresents(0)behindSharedSlotInFlight).PresentationPassnow draws such an image straight into the swapchain image in one fragment pass. It reads the raw texels through anR32_UINTview and decodes them as the guest-memory path does (the display's channel order, the 10-bit variant truncated to 8 bits). It scales with a bilinear filter of the decoded values and writes black outside the aspect-fit rectangle, so there is no intermediate buffer and no clear. Its descriptor set is per present slot, so it doesn't wait for other presents. The swapchain staysB8G8R8A8_UNORMand also allows color-attachment use.PresentationPass::Bindthrows for such a buffer.Tested
Linux (CachyOS, kernel 7.2, GCC 16.2, RTX 4090, NVIDIA 610.57.04), Release,
BUILD_TESTING=ON, onmain0214069e33.agc_driver_presentation_pass(exit 77 without Vulkan). For both 8-bit and both 10-bit channel orders it compares the pass with the convert path: identical at 1:1 and letterboxed, within two levels when scaled; a 10-bit destination keeps every source bit. It also checks that dumps equal the subsampled guest-path frame, that the band clears equal a full clear, and that a 16-bit float display buffer is refused. The existing resident-present conversion tests (including 16-bit float) are unchanged and pass.ctest -R "agc|shader|video": 505 of 505. The presentation tests pass again merged ontomain30f961266.python3 tools/check_conventions.py --base origin/mainpasses.PPSA21564 scans out a 3840x2160 10-bit buffer.
main30f961266against the same commit with this change merged, same build options, warm caches (one warm-up run each, not counted), runs alternated main, change, main, change. Title and menu are frames per second over fixed windows; the level is milliseconds per present over level frames 400 to 1200 (below 30 fps it advances a fixed step per frame, so frame indices compare like for like). A browser was open during all runs, on both sides. Onemainrun of the third pair is left out because its presses landed during the intro and it never reached the level; a fourth pair replaced it.main(n=3)With
APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1(one run each),present-blitGPU time per present: 2.49 ms onmain, 0.11 ms with this, the same before the level and in it. The same runs: title 21.6 and 23.05 fps, menu 18.9 and 19.5 fps, first level 32.6 and 28.9 ms.Summary lines, captured as the Performance report form describes (no
APS5_PROFILE_*, caches warm), two runs each,mainfirst in each pair,APS5_TRACE_SECONDS=155:5(5 s in the first level).APS5_LOOP_GUARD,APS5_PAD_PRESSandAPS5_DUMP_FRAMESare set by my test harness on both sides; the other three variables it sets are not read bymain. The window starts at a fixed time, and the level starts 122 to 143 s into these runs, so the four windows cover different parts of the level; the frame-index numbers above are the like-for-like comparison. Over level frames 400 to 1200 these runs measured 35.9 and 30.6 ms onmain, 29.6 and 27.8 ms with this. The traces are not attached (the PR was edited from the command line); I can add them.Not tested: Windows, AMD, a title that presents an 8-bit display in the other channel order on a device.
Checklist
main; no other open PR implements the same functionsNotImplemented_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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T17:06:00Z.
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)core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL16-17, L360, L696-697, L1705, L2382, L2850-2857core/libs/prx/libSceAgcDriver/Execution/include/PresentationScaler.hppL32core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL2797-2798, L2808-2839, L2932-2933