perf(agc): pipelined draws on by default #1202
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1202"
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 MichonGoddijn231849 on 2026-10-07T17:29:10Z.
What
Turns the queue-0 draw pipeline from #1201 on by default:
APS5_PIPELINED_DRAWSis on (depth 8) unless set to0.APS5_EXACT_DRAW_WRITESis on unless set to0: queued draws carry the exact color, DCC, CMASK, depth and stencil sizes instead of the estimates.DMA_DATAfill notes HTILE and CMASK fills in order, as the packet path does (Michon's commit;agc_driver_depth_fast_clear_submitfailed without it withAPS5_PIPELINE_DMA=1).APS5_PIPELINE_DMAitself stays opt-in here; making it the default is #6208.agc_driver,agc_driver_pm4_failure,agc_driver_draw_cache_reuse, ...) now run with the pipeline on, as asked in review;agc_driver_pm4_failure_inlineandagc_driver_draw_cache_reuse_inline(APS5_PIPELINED_DRAWS=0) keep the inline path covered.Reshaped after #1201 merged. Left out of the old head (backup:
adriadam10/AnyPS5branchbackup/MichonGoddijn231849-perf-draw-path-trims, c653e9ea1d):main's own unwritten-snapshot and moved-word caches (98ce8af56d,b0001cb676), and the arena goes in its own PR as agreed above;agc_driver/agc_driver_pm4_failurewith the pipeline off): a failed commit now goes throughReportFailure(#1201), so they pass with it on;Open review points from the thread: the loading hang (fill under the GPU lock) is fixed by c653e9ea1d in #1201; failed commits fail like the inline path (#1201); the CB metadata pass drains first (#1201, c50e23120c). The CMASK-of-DCC abort fma-rc saw on fda7dbf04 has no rerun since.
Tested
Linux, Ryzen 5 7535HS / Radeon 660M, RADV, GCC,
ANYPS5_ENABLE_SPIRV_TOOLS=ON,ctest -R 'agc|shader'(595 tests):APS5_PIPELINED_DRAWS=0: 594/595APS5_PIPELINE_DMA=1: 593/595; the extra failure isagc_driver'scopiesToHostMemorycount check (the copy is enqueued, the bytes are right), which is #6208's to settle--repeat until-fail:20over the pipelined, fill, predication, label, draw-cache, failure, fast-clear and DMA tests withAPS5_PIPELINE_DMA=1: 33/33The only failure in every mode,
agc_driver_tessellation, segfaults onmaintoo on this GPU. Windows full build dispatched next.Game reports on the pipeline (on #1201's c653e9ea1d): mrfelek Diablo II +51 %, Castlevania +67 % presents/s; JAB-dev Besiege 20→33, HSG2 19.5→36.6, Vampire Survivors 25-28→48-58. @fma-rc, an Astro's Playroom run on this head would tell whether the CMASK-of-DCC abort is still there.
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 fisherjoey on 2026-10-08T08:03:10Z.
Test result: Demon's Souls on Linux/NVIDIA with #1202 (and #1201 under it) on by default
Setup: Nobara 44 x86-64, kernel 7.2, RTX 5070 Ti, NVIDIA 595.91.07. Demon's Souls (PPSA01341 v1.07), tutorial level (Outpost Passage), steady state for about 150 s after the HUD appears. Base is upstream main
df16c4c2plus #861, #864 and #157, our local fixes (including the NVIDIA dma-buf import guard) and a job-worker idle sleep for this title. The PR side is the same tree with this PR merged, plus #1071, which only touches shutdown. The merge conflicted in 5 files against our tree (Dispatch.cpp, WrittenBuffers.cpp, PacketExecution.cpp, Submission.cpp, ShaderResources.cpp), all because of our local changes. The only code fix it needed was our ownnoteLabelStoresignature incommitLabel/commitDmaStore. Env: APS5_PROFILE_DRAW=1, APS5_TEXTURE_CACHE_MIB=8192, APS5_PIPELINE_CACHE_ENTRIES=4096, APS5_BINDLESS_SLOTS=48. Shader cache warm. The level is still CPU-bound on queue 0.Two runs per side. Numbers are medians of the 10 s windows in the steady state:
Median fps goes from 1.43 to 1.90 (+33 %), and both PR runs beat both base runs. Queue 0 spends about 0.7 s less per 10 s in Graphics::Draw while getting through about 40 % more draw packets. The run logs show no new error signatures, and the picture is unchanged. Driver ctest -j1: 412/413. The one failure (guest_force_tls_destructor) also fails on main.
Unrelated to this PR: both PR runs still crash at teardown when the window closes (one double free, one SIGSEGV), and so does the base.
AI-assisted: yes (an agent ran the builds, the game runs and the measurements).
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T16:21:22Z.
@MichonGoddijn231849 a follow-up to the test result above, about your next step of keeping compute dispatches from draining the pipeline. On Demon's Souls that looks like the main remaining gap, so I wanted to check where you are with it before we write anything.
Per frame in the tutorial level (queue 0, same stack as above, ~2.2 fps, 448 ms on the worker):
DRAW_INDEX_INDIRECTand run inline on the workerThe committer is ~4.6% busy here while the worker is pegged, so the time goes to the dispatch path and to indirect draws that #1201 doesn't pipeline. About 2.6k of the dispatches are one chain of small dispatches (program
0x248994d00, ~21 us of GPU each), and each one drains the pipeline before the next draw.Two questions:
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-08T16:30:06Z.
@fisherjoey thanks, a second title with numbers is really useful, and the dispatch chain in Demon's Souls makes the case better than GTA V does.
PrepareDispatchthe way draws are split: stage A (capture, recompile, resources) on the worker, stage B (the recording) as an ordered commit item on the committer, so a dispatch no longer drains the pipeline; one reading what a preceding draw wrote stays ordered behind it. I'll put it up as a follow-up PR on top of #1202 and ping you when there's a branch to test on Demon's Souls.DRAW_INDEX_INDIRECTwhose arguments the GPU wrote needs them read at commit time (or recorded asvkCmdDrawIndexedIndirectwhere the draw allows it). If you want to take that one, go ahead; it won't overlap with the dispatch work.Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T16:41:57Z.
Thanks, that split sounds right, and I'll test the dispatch branch on Demon's Souls when you ping. I'll take the indirect draws:
DRAW_INDEX_INDIRECTwith GPU-written arguments read at commit time, recorded asvkCmdDrawIndexedIndirectwhere the draw allows it. I'll put it up as a separate PR on top of #1202 with Demon's Souls numbers.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-08T18:23:04Z.
@fisherjoey the dispatch follow-up is up as #1747 (stacked on this one), behind
APS5_PIPELINE_DISPATCH=1. A dispatch whose cache entry hits with a recipe becomes an ordered commit item; misses and reads of still-pending writes drain as before. GTA V shows no change (few dispatches between draws), so Demon's Souls numbers would be the real test.Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T22:55:22Z.
@MichonGoddijn231849 the indirect-draw part is up as #1896, stacked on this PR, behind
APS5_PIPELINE_INDIRECT=1. On Demon's Souls it takes the level from 490 to 441 ms per frame across two 3+3 batches, with no argument-overlap drains (all of the title's indirect draws take the GPU-side path).Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:03Z.
Parked as a draft while I port the pipelined draw path onto #639. @fisherjoey thanks for #1896; once this stack is ported I'll ping you so it can follow on top.
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T13:21:25Z.
Data point for the WordMask part of this: in Hades II (PPSA36082) gameplay on Linux / RTX 4090, ShaderMemory::Regions + TakeRecentRegions were about 18% of the draw thread (bit-by-bit run scan, every stage of every draw). With a word-at-a-time scan like yours they drop to about 1%, and gameplay went from 30-35 to about 45 fps.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T14:39:42Z.
Thanks, that is a great data point. Good to see the word-at-a-time scan carry over to Hades II.
Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-11T16:44:19Z.
Tried the target refresh-proof memo on Hot Shots Golf 2 (PPSA06699, Windows, RTX 4070 SUPER), same demo loop, memo off vs on (2 runs each):
Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-12T21:35:54Z.
Vampire Survivors (PPSA21703, Windows 11, RTX 4070 SUPER) with the pipelined draws on, against plain
main.mainalone: about 25-28 FPS in heavy scenes (late run, many enemies and projectiles).Menus and level-up screens hold 60 FPS.
Second title on Windows after Hot Shots Golf 2, and the first where the stack is the difference between about 25 and about 50.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-13T16:02:17Z.
Rebased onto current
main(a56c905df), on top of the rebased #1201 (#494 → #1191 → #1193 → #1201 → #1202).mainmoved a lot under this one, so I ported it rather than replaying it: the pipeline identity path, the snapshot ring with fresh copies and moved buffers, the code hash memo and the defaults are in.mainhas its own storage-image refresh proof now, so this PR's memo is gone. The shared draw-stage result and the two memos that never paid are left out. Details are in the description.The DMA pipeline being on by default exposed a real bug: a pipelined
DMA_DATAfill skipped the HTILE and CMASK notes from #374 and #419 (agc_driver_depth_fast_clear_submitfailed). That's fixed in its own commit. Theagc_*suite passes with the defaults and with the switches off.@JAB-dev thanks for the Hot Shots Golf 2 and Vampire Survivors runs. These numbers were before the rebase, so a re-run on this head would be welcome.
Imported from boykopovar/AnyPS5. Originally posted by winstrex on 2026-10-13T17:11:49Z.
The Pathless (PPSA01825, 02.000.000), main menu. Windows 11, RTX 5070 Ti, WinLibs GCC 15.2.0 Release. Base is
mainc422b57fb+ #4491 (needed to reach the menu); the change is the same base with this PR's head merged, so the whole series (#494, #1191, #1193, #1201, #1202) with its defaults. Both merged cleanly.APS5_TRACE_SECONDSwindow of 12 s at the menu, warm caches, runs alternated base/change, 3 valid runs per side (runs lost to the Wwise crash of #361 were repeated):The base of this batch came out slower than an earlier batch on the same build a few hours before (100.3 ± 2.8 ms, 9.98 ± 0.28 FPS); against that one the series is -22 ms per frame (+28 % FPS).
In one trace of each side, queue worker 0x0 goes from 97 % busy to 89 %, and the GPU from 26 % of the time busy (31.0 ms per present) to 39 % (30.3 ms per present), so the GPU now waits less but the CPU side is still the limit. Window captures look correct on both sides (the menu background animates, so I did not compare frames pixel by pixel), and the logs show no errors on either side.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-13T17:20:06Z.
One more fix folded into the main commit: the pipeline identity memo held a
thread_localwith a destructor, whichprx_thread_local_destructorsrefuses (MinGW frees those before they run). It usesShaderRecompiler::ThreadOwnednow, like the rest of the driver.prx_thread_local_destructorsand theagc_*suite pass on Windows.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T18:16:16Z.
Astro's Playroom (PPSA01325) does not get past its loading screen with this PR here (Linux, RTX 5080). Head fda7dbf04 plus the include from my comment on #1191, which it still needs to build on Linux, against its merge base
a56c905df:The abort is
AGC graphics: a CMASK fast clear of a DCC color target, whose clear belongs in its DCC keys, was recorded.In a fourth run I took all thread stacks 90 s after the log went silent. The driver thread is in
Driver::dispatch->GpuMutexType::lock(), the pipeline thread is inDrawPipeline::run->Driver::commitDraw->GpuMutexType::lock(), and the submitting guest thread waits inDriver::holdFlipBehindWorker. Every other driver thread is idle in its condition wait.The previous head 823722d0d did the same in 7 runs (6 at the limit, 1 abort). 490 of 490
agc|shadertests pass. With #1201 alone the title loads and runs at 6.4 to 6.6 FPS against 6.0.Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-13T18:17:25Z.
Re-run on the rebased head (
fda7dbf04) againstmainata56c905df, Windows 11, RTX 4070 SUPER, 1080p:Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:10:32Z.
Before the pipeline can be on by default:
GpuMutexType::lock(), the guest inholdFlipBehindWorker) and the CMASK-of-DCC abort;DrawPipeline.cpp:126-131), while main rethrows from the packet (PacketExecution.cpp:292-295). It should fail the same way, soagc_driverandagc_driver_pm4_failurepass with the pipeline on instead of being run with it off;precheckDrawordered behind the queued draws, as you noted on #1201.Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-14T00:42:05Z.
Moving this here from #1895, as @oneandonlydean asked.
With this stack, a direct draw on queue 0 becomes a commit item and the packet worker moves on. An indirect draw (
DRAW_INDIRECT,DRAW_INDEX_INDIRECT,DRAW_INDEX_INDIRECT_MULTI) still drains the pipeline and recordsGraphics::Drawinline on the worker, under the GPU mutex (theDrainReason::Indirectdrain at the top ofDriver::draw).Most of Demon's Souls' draws are indirect, so most of its draw recording stays on the worker. Numbers from the tutorial level on Linux, RTX 5070 Ti,
APS5_PROFILE_DRAW=1, per 10 s, on this PR's head as of 10-08 (before the 10-13 rebase):DRAW_INDEX_INDIRECT: ~223k packets, 4.6 s of queue-0 time. Direct draw packets (DRAW_INDEX_OFFSET_2): ~19k.Graphics::Drawon the worker: 1.8-1.9 s.All of these take the GPU-side argument path (
[indirect] gpu-side, cpu-side 0), so the drain isn't protecting a CPU read of the arguments.#1896 (draft) enqueues indirect draws as commit items and drains only when the argument range or the count dword overlaps a pending write. On the 10-08 head that took the frame from 490 to 441 ms. I'm rebasing it onto fda7dbf04 so its diff is only the indirect-draw files, and will post new Linux NVIDIA numbers there.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-14T01:13:22Z.
agc_driver_pattern_buffer_fillfails intermittently on this head when other agc tests run at the same time. Alone it passes.Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, driver 595.91.07, GCC 16.2, Release,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF. Each run is the test binary started directly whilectest -j5 -R agc -E pattern_buffer_fillloops in the background.maina56c905df(this stack's base)Every failure is the same line:
That is the second half of
PatternBufferFill.cpp: the labels toControl[0],Control[1]andPattern[0]written between the two fills.Switches on fda7dbf04, 30 runs each under the same load:
APS5_PIPELINE_DMA=0APS5_PIPELINED_DRAWS=0APS5_PIPELINE_DRAIN_FILLS=1AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-14T04:53:37Z.
Demon's Souls stalls before the title screen on this head on Linux with NVIDIA.
APS5_PIPELINE_DRAIN_FILLS=1makes it go away. That switch also fixed thepattern_buffer_fillfailure I posted above, so the two may be the same race. They don't match exactly:APS5_PIPELINED_DRAWS=0fixed the test but doesn't fix this stall.Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, driver 595.91.07, GCC 16.2, Release,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF. Every run is a cold boot (empty shader cache), capped at 150 to 240 s, with no input, so the game stops at the title. The build is fda7dbf04 alone, with no other PRs merged. It does contain my #1896, but that only runs withAPS5_PIPELINE_INDIRECT=1, which none of these runs set.7a0c838ca7a0c838ca+ #5181APS5_PIPELINED_DRAWS=0APS5_PIPELINE_DRAIN_FILLS=1APS5_TRACE_GPU=1The same stop (4025 shaders, 2 frames) also shows up three more times with #758 merged on top, with and without #5181, so those merges don't cause it.
When it stops, the main loop has started and
ResourcePool::GatherResourceFileInfo()has finished (after 108 to 136 s). After that, nothing more compiles and no frame is presented, and the log shows no error. In a stack dump at t+200 the game's worker fibers are still running in game code. All seven AGC queue threads are inDriver::run→execute→waitMemory→PollSleep, but runs that reach the title show that same picture, so the dump does not identify the stuck wait.With
APS5_TRACE_GPU=1, which prints every wait, the game reached the title. That fits a race between the pipelined fill and the label or wait that follows it.I don't have the address of the stuck wait yet. The driver's WAIT_REG_MEM timeout report does not fire here:
WaitMemory.cpp:356restarts the timer wheneverpacketsInFlight != 0, so the 1 s report at:361is never reached while other queues have work in flight. A local build that never restarts the timer reached the title in its only run, so it didn't catch the stall either. Its long waits were all compute queues waiting for the game to set a flag to 1, and each one cleared.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T07:00:33Z.
A data point on a part of this PR that does not need the pipeline. A draw-snapshot arena like the one here (
AllocateDrawSnapshot, small snapshots sliced from one buffer per batch) also pays off when the driver thread records draws inline, as it does onmain.Astro's Playroom (PPSA01325), heavy first-level scene, RTX 5080, Linux, upstream's trace with 3 s windows (no dropped events): on
main00f4b3351plus eight local draw-thread changes, frame p50 is 84.3 to 88.1 ms over five runs with the arena and 95.8 ms in one run with only the arena taken out. Plainmainis at 133 ms. The captured frames show the same picture.Since the pipeline is held for the hang and the abort, the arena might be able to land on its own first.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-14T08:36:22Z.
Thanks all, this is exactly what the stack needed. @winstrex @JAB-dev thanks for the numbers.
Before the pipeline can be on by default, in the order I'll take them:
agc_driver_pattern_buffer_fill, 19 of 80 here against 0 onmain). I see the same intermittent failure on my side (fill did not observe preceding GPU results and labels at 0). ThatAPS5_PIPELINE_DRAIN_FILLS=1fixes it says a pipelined fill is ordered behind queued draws by its label but not by the writes it must see. This is probably also behind Demon's Souls stalling before its title screen.GpuMutexType::lock()and the guest inholdFlipBehindWorker, and the CMASK-of-DCC abort. The abort looks like the pipelinedDMA_DATAfill path again: a fast clear recorded for a DCC target whose clear belongs in its keys.maindoes (PacketExecution.cpp:292-295), soagc_driverandagc_driver_pm4_failurerun with the pipeline on.precheckDrawordered behind the queued draws (owed from #1201).@fisherjoey, indirect draws draining the pipeline: agreed, that's where Demon's Souls' draws go. It's a follow-up after this stack (the indirect arguments have to be read after the draws queued before them), not part of this PR.
@fma-rc thanks for the draw-snapshot arena data point on
main. If it holds without the pipeline, it could go in on its own ahead of the stack.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T18:29:52Z.
@MichonGoddijn231849 there were two bugs in the pipelined fill path, both in
Driver::fillBuffer(BufferFill.cpp):pattern_buffer_fillfailure (5 of 30 runs on fda7dbf04 here, 0 of 30 with the fix).inputLock) when it callsEnqueue. With the pipeline full,Enqueuewaits for the committer, and the committer's next item waits for that lock. That deadlock matches @fma-rc's stacks:commitDrawanddispatchboth inGpuMutexType::lock(), the queue-0 worker inEnqueue's condition wait.The fix drains only when a queued item writes the fill's input range (the same check the waits use), releases the input lock before
Enqueue, and makesEnqueuethrow if it has to wait for room while its thread holds the GPU lock. I pushed it to this branch as c653e9ea1d1, one commit on top of fda7dbf04, with a test that fails both ways without it (tests/execution/PipelinedFill.cpp). Drop or reshape it if you'd rather do it differently. The Linux build also needs @fma-rc'sHostThreadLocal.hppinclude fix from #1191 (it sits inside#ifdef _WIN32inGuestBufferMemory.cpp); I left that to #1191.@fisherjoey could you run Demon's Souls again on that commit, including one run with
APS5_PIPELINED_DRAWS=0? The pipeline can't deadlock with that setting, so if that run still stops at 3992 shaders, the stall has another cause in the stack.@fma-rc agreed. The arena is ready on its own without the switches (
perf/draw-snapshot-arena-1014), and I'll open it once I have clean numbers.Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T19:26:02Z.
Diablo II: Resurrected on this PR: about +51% presents per second
Title: PPSA03912, 01.039.000, standing in the Rogue Encampment
System: Linux, RTX 3080 Ti (NVIDIA 615.71.09)
This PR's head: c653e9ea1, pipeline on by default
The PR conflicts with current
main, so I ran it on its own base:maina56c905dfplus the four PRs the title needs, cherry-picked (#5003, #5205, #1186, #5779).Results
Presents per 10 s over the steady windows, three alternating runs each (warm-up windows of 1 to 13 left out):
That is about +51%. Six more launches of B later gave the same steady state (54 to 58).
What changed besides the frame rate
Stability while the world loads
I launched both builds repeatedly and classified each launch (11 with the PR, 6 without):
The title's own crash is a null lookup in its hash-table code (
app.elf+0x1b99787); it also happens on other builds, about once in five launches. The two PR-only problems were both during loading:extended register semantics are not implemented (offset dword 0x31a731a7), thrown fromVideoOutDriver::presentLoop.perfsample of that thread shows it in the game's own code (addresses insideapp.elfplus guestmemsetandmemmove), not in the driver. I could not get a usable core dump (it came out truncated), so I cannot say which routine it was.One more thing
It does not build on Linux as pushed.
GuestBufferMemory.cppincludesprx/libc/include/HostThreadLocal.hpponly under#ifdef _WIN32, but usesHostThreadLocal<ReadableRanges, ReadableRangesStorage>()at line 2061, so the compiler says "'HostThreadLocal' was not declared in this scope". I included the header unconditionally for these runs.AI-assisted; the runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T21:40:32Z.
Diablo II with this PR: the GPU is now the limit (Nsight Systems trace)
Follow-up to the numbers above, same setup: PPSA03912 in the Rogue Encampment, Linux, RTX 3080 Ti (NVIDIA 615.71.09), this PR's head c653e9ea1 on
maina56c905dfplus the four PRs the title needs. Nsight Systems 2025.5, Vulkan trace, about 6 s in game with 44 presents (about 5.5 FPS).What a frame does
vkQueueSubmitvkCmdBindPipelinevkUpdateDescriptorSetsvkAllocateDescriptorSetsvkCreateBuffervkCmdPipelineBarrierSo there is about one pipeline bind per draw, a few thousand descriptor updates per frame, but few barriers.
Where the time goes
vkWaitForFencestakes 2.3 s of the capture's 2.6 s of Vulkan API time (133 calls, about 17 ms each): the CPU spends most of its API time waiting for the GPU.nvidia-smi, 45 s in game: GPU utilization is 62% on plainmain(mean, range 24 to 79%) and 86% with this PR (mean, range 50 to 100%).So on
mainthe title is limited by the CPU thread and the GPU waits for it; with the pipeline the CPU limit is mostly gone and the GPU is close to saturated. That puts the ceiling after this PR at roughly 155 ms of GPU time per frame (about 60 us for each of about 2,600 draws).What I could not see
I have no GPU performance counters here (Nsight's GPU metrics need a driver permission I have not changed), so I cannot say which draws or passes make up that 155 ms. Candidates are the 3840x2160 targets, blending over large areas, and what each draw's sampled images need. If someone has a GPU capture tool, a frame of this title is a good case.
AI-assisted; the runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T23:49:04Z.
Castlevania: Belmont's Curse on this PR: about +67% presents per second
Title: PPSA35399, 01.000.000 (Unity IL2CPP), in game after the opening cinematic
System: Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09)
This PR's head: c653e9ea1, on
maina56c905dfplus #5003, #5205, #1186 and #5779 (the same base as my Diablo II numbers above)Also on both builds: #5456 (2D compare on 1D T#s) and
c8662b6bc(alpha-to-coverage without a color target), because this title does not get to its first screen ona56c905dfwithout themResults
Each row is one run, about 2 minutes in game, steady-state windows of 10 s.
main(eea428ca8, without this PR) gives 35–36 presents per 10 s (3.5 FPS), somainhas recovered part of the difference on its own. I have not rebased this PR onto it (it conflicts in 13 files).Linux build
The PR does not build on Linux as pushed:
GuestBufferMemory.cppincludesHostThreadLocal.hpponly under#ifdef _WIN32(line 14) but usesHostThreadLocalat line 2061. This one-line change fixes it, and is the only change I made to the PR:Stability matches what I reported above: this run was clean for about 2 minutes on each build.
AI-assisted; the runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T03:31:19Z.
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.txtL1642Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T10:22:12Z.
Rebased after #1201 merged and reshaped (details in the description): this PR is now just the default switch (
APS5_PIPELINED_DRAWSandAPS5_EXACT_DRAW_WRITESon) plus the DMA_DATA metadata-fill fix. The snapshot ring and the other trims are out (they conflict with main's snapshot caches; the arena goes in its own PR). The base tests now run with the pipeline on, and*_inlinevariants cover the old path. Localagc|shader: 594/595 both on and off (onlyagc_driver_tessellation, red on main here), stress 33/33 ×20. Old head backed up atadriadam10/AnyPS5backup/MichonGoddijn231849-perf-draw-path-trims.