feat(agc,videoout): save the displayed frame as a PNG with a screenshot key #2501
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2501"
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 dantdmdarealguy on 2026-10-09T23:16:55Z.
What
Adds a screenshot key. F12 in the game window saves the next displayed frame as a PNG at the display buffer's resolution, without the window's scaling or letterbox. Files go to
anyps5-screenshots/beside the executable, or toANYPS5_SCREENSHOTS, and are named<title ID>-<YYYYMMDD-HHMMSS>.png. The key is a newScreenshotaction inanyps5-input.ini; likeToggleFullscreenit accepts onlyKEY:sources.Today the only way to capture a frame is
APS5_DUMP_FRAMES, which writes downscaled BMPs of the first N frames from start-up. That doesn't help with a frame at a particular moment (a rendering bug, a compatibility report), and CONTRIBUTING asks for screenshots in PRs.How it works:
PadInputhandles the key-down likeToggleFullscreen(focused game window, no key repeat) and calls the newAgcDriverRequestScreenshot_nid_postfix(), which sets an atomic flag (AgcDriver::Screenshot).VulkanDevice::PresentDisplayBuffertakes the flag and reuses the GPU frame-dump readback thatAPS5_DUMP_FRAMESalready records in the presentation command buffer, at scale 1. This covers the resident (direct blit), detiled, uniform-clear and linear (tilingMode == 1) paths. The readback is written after the slot's fence, on the existingFrameDumpWriterthread, so encoding never blocks the presenter.APS5_DUMP_FRAMESalso dumps, the screenshot waits for the next frame.decoder_png(Decoder::Png::Encode, already used by libScePngEnc) as 8-bit RGB. Alpha is dropped because the presented image is opaque.No guest-visible behaviour changes.
sceShareCaptureScreenshotis untouched.Tested
Windows 11, WinLibs GCC 15.2.0 (
15.2.0posix-14.0.0-ucrt-r7, as in CI), full build onc9d42619:cmake --build buildandcmake --build build --target libssucceed.tools/check_test_registration.pypasses.ctest --parallel 4: 546/548 pass, 1 skipped (guest_video_out_wqhd_detection_no_vulkan, expected with a Vulkan device), 1 failed (hardware_oracle). That test exercises thetools/hw-oraclescripts, which this PR doesn't touch. It fails because theld.lldon my PATH (LLVM 18) rejects the AMDGPU object (unknown file type).agc_screenshotpasses: merged requests,ANYPS5_SCREENSHOTSwith a directory that doesn't exist yet, title-ID naming, no overwrite within the same second, BGRA to RGB with opaque alpha (decoded back withDecoder::Png::Decode), and rejection of invalid frames.patched_librariespasses, so the patchedlibSceVideoOut.prxloads with its newAgcDriverRequestScreenshot_nid_postfiximport. The second commit was needed for that. Without--exclude-libsfordecoder_png, MinGW exportedDecoder::Png::*fromlibSceAgcDriver,libSceVideoOut(which now decodesicon0.png, #1080) boundDecodeto it, and the patched library failed to load with error 127.libSceVideoOut.prxon currentmainat all, I applied #2473 locally; it isn't part of this PR. Without it,nid_patcherstops withduplicate patched export name: LibwuIonIBwfrom #1339, independent of this change.python3 tools/check_conventions.py --base origin/mainpasses.APS5_NO_RESIDENT_PRESENT=1, and check the PNG.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 github-actions[bot] on 2026-10-09T23:30:01Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T23:32:51Z.
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/CMakeLists.txtL673core/libs/prx/libSceAgcDriver/CMakeLists.txtL673core/libs/prx/libSceAgcDriver/CMakeLists.txtL673core/libs/prx/libSceAgcDriver/CMakeLists.txtL673core/libs/prx/libSceAgcDriver/CMakeLists.txtL673Pull request closed