feat(agc,videoout): show an optional performance overlay with F10 #6012
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6012"
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 EagleBearerYS on 2026-10-14T19:19:06Z.
What
An on-screen performance overlay, drawn over the presented frame. It's off by default; F10 shows or hides it at any time, and
ANYPS5_OVERLAY=1shows it from the first frame.ANYPS5_OVERLAY_POS=tl|tr|bl|brpicks the corner.No title needs this to run. While the overlay is hidden, the present path does one relaxed atomic load and records exactly the commands it recorded before: no pass, no allocation, and frame dumps are unaffected. The only work that also happens while hidden is counting:
Memory is read only while the overlay is shown.
Why: the Game bring-up form asks for "the frame rate there". Today the window title shows one number for it, presents per second averaged over 2 s, and that isn't visible in fullscreen. The overlay shows the frame rate and frame times in a window or fullscreen, and next to them where a frame's time goes:
The panel at 1080p in the top-left corner, plain (left) and with both profile switches on (right). This PR's own code (
ComposeOverlay,PerformanceOverlay::Recordand its shaders) drew them on lavapipe over a synthetic gradient, with fixed sample values, cropped to the panel. 720p draws at the same scale.It shows:
PROFILED: the first line whileAPS5_PROFILE_GPUorAPS5_PROFILE_DRAWis on. Those switches add timestamp queries to every batch and timers to every packet, so the numbers of such a run aren't comparable with an unprofiled one.FPS: presents per second over the last second, including cleared presents. Below 1 fps it's the last frame's rate: a frame every 2 s reads0.50.FRAME: the time between the last two presents, plus a graph of the last 120.MIN/AVG/MAXover those 120.GPU(only withAPS5_PROFILE_GPU=1): batch spans per frame over the last second, or of the last frame below 1 fps, from the existing timestamp queries.DRIVER(only withAPS5_PROFILE_DRAW=1): the packet workers' dispatch and draw time per frame, the[gpu] workernumbers, likewise.DRAWSandDISPATCH: draw and dispatch packets per frame as the packet workers execute them, likewise. Packets that predication skips aren't counted.SHADERSandTOTAL: pipelines created in the last second, or during the last frame below 1 fps, and since the start.VRAM: usage and budget of the largest device-local heap fromVK_EXT_memory_budget, read once a second. It isn't shown without the extension.RAM: the process's private memory, read once a second:PrivateUsageon Windows,RssAnonplusVmSwapon Linux. The title's direct memory is shared memory and isn't included.RES: the display buffer's size, then the swapchain's, for exampleRES: 3840X2160 / 1920X1080.Each of the last five lines appears only once it has data. With nothing counted and no profile switch, the panel shows FPS, FRAME, the graph and MIN/AVG/MAX.
How:
OverlayStatistics) are fed at each present. The GPU and driver totals are relaxed atomics, which grow only where those profile switches already measure.Driver::execute's draw and dispatch branches.fetch_addat the end of theGraphics::Pipelineconstructor and inCreateComputePipeline, which the dispatch path and the capture replay use. The driver's own pipelines (presentation, detiler, the overlay) aren't counted.LargestDeviceLocalHeap, a public wrapper around that lookup (commits 7 and 14). RAM usesK32GetProcessMemoryInfofrom kernel32, so no psapi is linked, or/proc/self/status.PerformanceOverlay.cpp; no third-party code is added.PRESENT_SRC.TogglePerformanceOverlayinput action: keyboard only, likeToggleFullscreen, and remappable inanyps5-input.ini.ANYPS5_OVERLAYorANYPS5_OVERLAY_POSvalue stops at the first frame with an error naming the variable, asANYPS5_LANGUAGEdoes.present(). The next present shows the stall inFRAME.Commits:
feat(agc): the overlay, its statistics, the font and the pass, withagc_performance_overlay_statisticsandagc_performance_overlay.feat(videoout): F10 and the input action, with thepad_keyboard_mouseandpad_input_mappingcases.docs: USAGE ("Performance overlay") and INPUT_MAPPING.docs: what the FPS and GPU lines count.docs: USAGE's section moves to just before "Windows crash diagnostics", next to the other switches for looking into a run. Other open PRs add their sections right after "HDR output", where it was.fix(agc): below 1 fps, FPS, GPU and DRIVER come from the last frame. Before this, Resident Evil Village's title at ~0.1 fps read FPS 0.0, GPU 0.0 MS and DRIVER 0.0 MS, because no one-second window held two presents.refactor(agc): the largest device-local heap lookup becomes public, for VRAM.feat(agc): the DRAWS/DISPATCH, SHADERS, VRAM, RAM and RES lines, with their counters.test(agc): their cases.docs: their USAGE rows, and what counting costs while hidden.fix(agc): SHADERS counts the last frame's pipelines below 1 fps, like the other lines.feat(agc): thePROFILEDline, from review.refactor(agc): compute pipelines are counted inCreateComputePipeline, the helper that creates them, rather than in the dispatch path, which #5989 has since moved. The capture replay path counts too.refactor(agc):LargestDeviceLocalHeapbecomes a wrapper aroundShaderResources.cpp's private helper, which stays as it is onmain, callers included. #6194 adds calls to that helper, so the two build together in either merge order.test(agc): the statistics test's tolerance helper is namedwithin, since MinGW's headers definenearas an empty macro.docs: likeGPU, theDRIVERline can exceedFRAME, because every busy worker's time counts.refactor(agc):Driver::timedadds theDRIVERtime after the worker profile report rather than before it. #6292 moves theAPS5_PROFILE_DRAWcheck to the top and rewrites the report's condition, the two lines it sat between, so the two now merge in either order. It counts the same.docs(environment): theANYPS5_OVERLAYandANYPS5_OVERLAY_POSrows indocs/dev/ENVIRONMENT.md, which lists every switch since #6078.Tested
The Windows and Linux runs below are at
62022e9362, merged withmaind92a8dad39. The two commits since then are a test helper's rename (commit 15, which also builds withneardefined empty, as MinGW's headers do) and a docs line (commit 16). The red checks, the Xvfb runs and the RTX 3070 and AMD runs are from the earlier commits named there.890c321842(from adriadam10's review) gives the overlay's attachment view the transfer usage its pass layouts need; its checks are in the first bullet.84cae0bda0fixes the RADV failure from the same review; its checks are in the second bullet.890c321842, the view usage:VUID-vkCmdBeginRenderPass-initialLayout-00898and 33 ×-00899before it, none with it, also with synchronization validation on (no hazards). Layers 1.3.275 and 1.4.304 check the image's usage rather than the view's and don't show these.agc_performance_overlaypasses, full panel included, on the RTX 3070 Laptop (driver 617.42) and the integrated AMD Radeon Graphics (Ryzen 9 5900HS, driver 31.0.21923.1000), at the same overlay code merged withmain0dc15620d2. It passes on lavapipe too. On GitHub's runners, at the same overlay code, the statistics and pad tests pass on both, and the overlay test passes on Linux (lavapipe) and skips on Windows without a Vulkan device (run).84cae0bda0, next, fixes it.84cae0bda0, the palette on RADV:'6' of 'FPS: 60.0' glyph pixel 2,0 is not white text: 0x4280161290. The test prints that number in decimal after0x; it is 0xff1e140a, the clear colour darkened by the panel twice: the text rectangles landed on the right pixels but drew withpalette[0], the panel's colour. llvmpipe from the same Mesa passed.palette[0]; the SPIR-V was valid. The shader now reads each entry at a constant index and selects one by the colour index.main0dc15620d2; and on GitHub's runners, 5 runs each: on Linux (lavapipe) the overlay and statistics tests pass, and on Windows the statistics test passes and the overlay test skips without a Vulkan device (run). The runners' only other failure is libkernel'sguest_kqueueon Windows, which fails onmainthere too. In a mirror of CI's Linux job at84cae0bda0(lavapipe, Mesa 25.2.8), the overlay and statistics tests pass 20/20.agc_performance_overlay_statistics(no GPU) covers:FPS: 0.50with that frame's GPU and DRIVER time;0.08with the 9999 caps;12K,999M, NaN and negatives);PROFILEDonly with a profile switch on;ReadProcessPrivateBytesrising by at least 48 MiB after 64 MiB is touched.agc_performance_overlay(Vulkan):60.0are exact, and alpha is kept.maintoo. The sixth,audio_out2_shutdown, then passed 20 of 20 on its own; nothing here touches audio.check_conventions.pyandcheck_test_registration.pypass. Merged with #6194 as well, it builds, and all 579agctests pass. Red checks:0.000000 FPSafter a 2 s stall, and passes with it.VK_LAYER_KHRONOS_validationincluding synchronization validation: no new validation messages.video_out_hdr_presentdraws the overlay on each of its 6 frames, and its frame dumps still match the CPU conversion. That was at98b9b57effor the first lines and ce8e338cf for the new ones, before the rebase.agc_interpolant_mappingafter it printed its pass line, a hang at exit in a test that doesn't reach this PR's code; the rerun passed it in 0.03 s. The runner has no Vulkan device, so the Vulkan tests skip there,agc_performance_overlayincluded. The RTX 3070 run below covers it.VK_DRIVER_FILES) for that process only.main0dc15620d2, takes a GPU median of 0.018-0.022 ms at 1080p and 0.102-0.103 ms at 4K (the 3070: 0.016 and 0.022 ms).ANYPS5_OVERLAY=1 APS5_PROFILE_GPU=1 APS5_PROFILE_DRAW=1, at the code before commit 6:FPS: 1.5,FRAME: 674 MS,GPU: 149 MSandDRIVER: 698 MS, with MIN/AVG/MAX 80.9/168/932.main, it readFPS: 0.0,FRAME: 9999 MS,GPU: 0.0 MSandDRIVER: 0.0 MS, because no one-second window held two presents. Commit 6 fixes that: with it, the full panel at the title readsFPS0.06-0.07, the same as the window title's counter (comment, which compares the other lines with the log).ANYPS5_OVERLAY=1from the start, because the test agent can't send keys to the game window. F10 itself is covered bypad_keyboard_mouseandpad_input_mapping, and hiding again byagc_performance_overlay.maine34c47921, with #5851, #5703 and #5815's two commits. Also local commits that prepare shaders at their first draw, fix title-stage stops, and approximate the per-pixel sample locations #5861 refuses on this GPU.ca7ea10d30, commit 18 on0172d28496, a merge ofmain0d078f75d3with no conflicts), on GitHub's runners (run): the^agctests pass on Linux (713, 0 failed), and the suites' only failure is libc'sprecise_waittiming test. On Windows the only failures areagc_driver_pm4_replay_toolandagc_shader_replay_tool, which fail the same way on that runner for an unrelated branch (run).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)Overlap: #4891 (F12 screenshot key) also appends an input action after
ToggleFullscreen. Whichever merges second keeps both lines. Its screenshots come from the frame-dump path, which reads the game's image, so they won't contain the overlay.#6292 (winpthreads locks and TLS off the draw path) restructures
Driver::timed: it checksAPS5_PROFILE_DRAWfirst and returns early when it's off. Since commit 17 the two merge cleanly in either order, and the DRIVER total behaves the same with or without it; after #6292 itsreportcheck is redundant.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T19:41:20Z.
Review: COMMENTED
Checked the integration points. While hidden,
presentdoes one atomic load and records the same commands as before. The driver counter sits behind the existingreportflag inDriver::timed, and the GPU counter is inreadGpuTiming, which runs only when GPU profiling is on. So there is no cost when it's off, and the test that hidden frames are byte-identical pins that. Nicely contained.One request: the
GPUandDRIVERlines exist only withAPS5_PROFILE_GPU/APS5_PROFILE_DRAW, and those switches change the timings they report (timestamp queries per batch, timers per packet). The Performance report form doesn't accept profiled numbers, yet an overlay screenshot is exactly what people will attach to a performance report. Marking the panel when a profile switch is on, for example aPROFILEDline or a different panel colour, would keep FPS and FRAME from a profiled run from being taken as unprofiled numbers.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-14T20:46:05Z.
Thanks for checking the integration points. Good point on profiled numbers:
907fc73d14adds aPROFILEDline at the top of the panel whileAPS5_PROFILE_GPUorAPS5_PROFILE_DRAWis on, so a screenshot of a profiled run says so.One change since your review: the PR now also has the lines I'd planned as a follow-up (DRAWS/DISPATCH, SHADERS, VRAM, RAM, RES). Their counters run while the overlay is hidden too: one increment of the packet worker's own counter per draw or dispatch packet (0.3 and 2.3 ns in two runs on cloud VMs), and one shared increment per pipeline created. So "no cost when it's off" is now that one increment per packet. The description gives the numbers.
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-15T03:19:58Z.
The checks promised in Tested, now with the extra lines in. Windows 11 (10.0.26300), RTX 3070 Laptop (driver 617.42), Ryzen 9 5900HS.
The tree was this PR through
46abaab054on our Village stack. Since then the head only moves a declaration (af3bd503cb) and one statement (62bbbb5dcc), and merges currentmain(67acc14910). That merge also renames one call:main's newStorageTextureBudgetused the helper's old private name, which this PR made public asLargestDeviceLocalHeap. At67acc14910the Build workflow's Windows job on my fork passes: 1254 tests, 0 failed (run).62bbbb5dcc, before the merge, built and passed on Linux with CI's flags.Tests on the 3070, with the Vulkan loader limited to NVIDIA's ICD as before:
agc_performance_overlay_statisticsandagc_performance_overlayboth pass.Resident Evil Village (PPSA01556) at its title, with
ANYPS5_OVERLAY=1 APS5_PROFILE_GPU=1 APS5_PROFILE_DRAW=1, read at three moments against the log:PROFILEDis the first line, and the full panel fits the game's 1100x619 window.main.[gputime]gives 511-525 ms per frame, averaged over its 10 s window, while the panel covers the last frame.TOTAL: 196, matching 0[pipecache]misses.3840X2160 / 1100X619.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:13:17Z.
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/user/INPUT_MAPPING.mdL19docs/user/INPUT_MAPPING.mdL19Some 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.
core/libs/prx/libSceVideoOut/src/InputMapping.cppcore/libs/prx/libSceVideoOut/src/PadInput.cppdocs/user/INPUT_MAPPING.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/include/Presentation.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libScePad/include/InputMapping.hppcore/libs/prx/libScePad/include/PadInputTypes.hppcore/libs/prx/libSceVideoOut/src/InputMapping.cppcore/libs/prx/libSceVideoOut/src/PadInput.cppdocs/user/INPUT_MAPPING.mddocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/user/USAGE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceVideoOut/src/InputMapping.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-15T18:21:01Z.
Thanks for the
PROFILEDline and the numbers. One increment of a per-worker counter per packet (well under 1 ns) and 0.016–0.022 ms of GPU time when the panel is shown are both negligible. The RE Village readings matching the log line for line are good evidence. Nothing more from me.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T21:12:23Z.
Review: CHANGES_REQUESTED
Thanks for the thorough PR. I built it merged onto current
mainand ran the AgcDriver/Pad/VideoOut tests.agc_performance_overlay_statistics,pad_input_mappingandpad_keyboard_mousepass, andagc_performance_overlaypasses on CI's lavapipe (Mesa 25.2.8). It fails on RADV (AMD Radeon 660M, Linux), though:agc_performance_overlayaborts in the full-panel case:'P' of 'PROFILED' glyph pixel 0,0 is not white text. The pixel only has the background blended; the text isn't drawn. The SDR, HDR10 and corner cases before it pass.VK_LAYER_KHRONOS_validationthe test reports 28 errors,VUID-vkCmdBeginRenderPass-initialLayout-00898and-00899(PerformanceOverlay.cpp:745): the image view is created withVkImageViewUsageCreateInfousageCOLOR_ATTACHMENTonly, but the render pass usesTRANSFER_DST_OPTIMALas initial layout andTRANSFER_SRC_OPTIMALas final layout, which requireTRANSFER_DST/TRANSFER_SRCin the view's usage. The!drawnpath inVulkanDevice::present(TRANSFER_DST_OPTIMALinitial layout) hits it in production too.TRANSFER_SRC | TRANSFER_DSTto that usage removes the validation errors here, but the full-panel pixel failure remains, so it has a second cause that lavapipe doesn't show. I didn't find it.Please run the test on a real driver (it should pass on RADV and on your AMD/NVIDIA runs with the current head, the AMD run in the description predates the later lines), fix the usage flags, and check what differs for the full panel (it is the case with the most rectangles; the buffer is recreated above 1024 rects).
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T22:11:10Z.
@adriadam10 thanks for running it on RADV. Here's where both findings stand.
1. The view usage (
VUID-vkCmdBeginRenderPass-initialLayout-00898/-00899): fixed in890c321842. The view'sVkImageViewUsageCreateInfonow addsTRANSFER_DSTorTRANSFER_SRConly when the pass's initial or final layout names it. Adding both bits unconditionally would breakVUID-VkImageViewCreateInfo-pNext-02662on the present path, because our swapchain images areTRANSFER_DST | COLOR_ATTACHMENTonly and that pass ends inPRESENT_SRC_KHR. The test's cost-report image ended its pass inTRANSFER_SRC_OPTIMALwithout that usage, so it now getsTRANSFER_SRCtoo.e09870006d, none at890c321842, also with synchronization validation on (no hazards). Layers 1.3.275 and 1.4.304 check the image's usage rather than the view's, so they don't show these errors.2. The full panel's text: not reproduced on our side, so there's no fix for it yet.
main0dc15620d2,agc_performance_overlaypasses, full panel included ("every line drawn bit for bit"), on an NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42, Windows 11) and an AMD Radeon iGPU (Ryzen 9 5900HS, Windows driver 31.0.21923.1000). It passes on lavapipe too.If you have a moment, two quick runs on RADV would tell those apart:
(
PerformanceOverlay.cpp, inRecord)2. The SDR case checking its whole line from the 'F':
(
tests/PerformanceOverlay.cpp,sdrOverlayTest)If either run fails, the number after "0x" in its message (printed in decimal) says what's on that pixel: about 4283183898 is the panel over the clear colour, which matches what you saw, and any other value means something else was drawn there. Your Mesa version would help too.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T22:46:39Z.
Review: CHANGES_REQUESTED
Thanks for the A/B diffs; I ran both on RADV (AMD Radeon 660M, Linux, PR merged onto current
main). Neither points at the buffer replacement:'P' of 'PROFILED' glyph pixel 0,0 is not white text: 0x4280161290.sdrOverlayTestchecking its whole line from the 'F', the SDR case fails too:'F' of 'FPS: 60.0' glyph pixel 0,0 is not white text: 0x4280161290. That value is the panel blended over the clear colour, so nothing was drawn there.So on RADV the pixel (0,0) of the first glyph of the first line is not drawn, in SDR as well; the full panel was only the first case that checked it. The rest of the line passes (
60.0is exact), so look at what is special about a text rect at column 0 / row 0 of its glyph: the first text instance, or the rect's left/top edge landing exactly on a pixel boundary (rasterization of an axis-aligned rect withgl_Positioncomputed in float, where a rounding of the edge could drop the first pixel column), or a rect that begins right after the background rect in the same draw.Please check that on a driver other than lavapipe and NVIDIA (RADV, or your AMD at the current head) and make the rect edges exact (e.g. positions that are exactly representable in NDC, or a half-pixel-safe rasterization), then the test should pass here.
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T22:52:14Z.
@adriadam10 Thanks for running both. They pointed us at the shader: it's fixed in
84cae0bda0, now on the branch.The failing value says a rect was drawn there, in the panel's colour.
0x4280161290(the test prints the number in decimal) is 0xff1e140a: the clear colour (191, 128, 64) darkened by 0.4 twice. The panel alone gives 0xff4c331a, darkened once. So the glyph's rect covered the right pixel, but it drew withpalette[0](0, 0, 0, 0.6), the panel's colour, instead of white.It reproduced on a second RADV machine (AMD Radeon RX 7600, NAVI33, Mesa 26.0.8), already in the SDR case:
'6' of 'FPS: 60.0' glyph pixel 2,0 is not white text: 0x4280161290, while the unset pixels before it passed. llvmpipe from the same Mesa passed.The cause: the fragment shader read
parameters.palette[paletteIndex], wherepaletteIndexis the flat colour index of each rect. The index differs between rects, so it can vary within a wave, and on RADV that dynamic index into the push-constant array gavepalette[0]. The SPIR-V was valid, and NVIDIA, AMD's Windows driver and lavapipe drew it right. How fragments pack into waves may also explain why your 660M drew "60.0" right but not the first glyph. The shader now reads each entry at a constant index and selects one by the colour index (one line).I've left the rect edges as they are: the pixel was covered (darkened a second time), so rasterization wasn't dropping it, and the other drivers match every text pixel bit for bit. If your run at
84cae0bda0still shows a missing edge, I'll look at the edges next.With the fix, every case passes on that RX 7600, full panel included, and on llvmpipe from the same Mesa, the RTX 3070 Laptop and the integrated AMD Radeon on Windows. GitHub's Windows and Linux runners are running it now (run). Could you rerun
agc_performance_overlayon your 660M at84cae0bda0?Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:12:28Z.
Review: APPROVED
Checked
84cae0bda0on RADV (AMD Radeon 660M, Linux, PR merged onto currentmain):agc_performance_overlaynow passes, full panel included, along withagc_performance_overlay_statistics,pad_input_mappingandpad_keyboard_mouse. The palette read with constant indices fixes the divergent push-constant index; merging once the full Build is green.