Repository navigation
feat(agc,videoout): save the displayed frame as a PNG with a screenshot key - #2501
Closed
dantdmdarealguy wants to merge 2 commits into
Closed
dantdmdarealguy wants to merge 2 commits into
dantdmdarealguy wants to merge 2 commits into
Conversation
…ot key F12 (the new Screenshot input action) requests a capture of the next presented display buffer. The presenter records it with the existing APS5_DUMP_FRAMES GPU readback at full resolution, and the frame dump writer thread encodes it with decoder_png into anyps5-screenshots/ beside the executable, or ANYPS5_SCREENSHOTS.
MinGW exported every decoder_png symbol from libSceAgcDriver, so libSceVideoOut, which lists libSceAgcDriver before decoder_png, bound Decoder::Png::Decode to it; after NID patching the import no longer resolved and libSceVideoOut.prx failed to load with error 127.
This was referenced Oct 9, 2026
|
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. |
|
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.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, feat(videoout): use sce_sys/icon0.png as the window icon #1080) boundDecodeto it, and the patched library failed to load with error 127.libSceVideoOut.prxon currentmainat all, I applied fix(videoout): remove duplicate VRR exports #2473 locally; it isn't part of this PR. Without it,nid_patcherstops withduplicate patched export name: LibwuIonIBwfrom feat(libSceVideoOut): register the VRR status event and accept the VRR status call #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)