perf: Red Dead Redemption (PPSA30528) G-buffer draws spend ~100x their GPU time reading vertex/index data in place from host imports #5895
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 bcortezf on 2026-10-14T15:00:06Z.
Title and scene
PPSA30528 (Red Dead Redemption), gameplay at Armadillo station right after the intro cutscene is skipped, 3840x2160, window 84-89 s after launch (
APS5_TRACE_SECONDS=84:5).What is slow or what changed
Gameplay runs at 3-4 FPS on an RTX 4070 SUPER and is GPU-bound: the presenter waits on the render fence for almost the whole frame. A per-draw breakdown with GPU timestamps shows that a single class of draws accounts for most of the GPU time:
An Nsight Graphics GPU Trace of those draws shows the GPU front end (GR) active ~98% of the time while the SMs are ~96% idle, with every unit under 2%. In other words, the draws are latency-bound, waiting on memory reads, not on shader work. The shaders themselves are not the cause: none of the open f32-fixup/denormal shader PRs changes their cost.
Cause: since
c903d1adf(#2253),InPlaceDrawInputbinds vertex and index ranges in place from theirVK_EXT_external_memory_hostimport instead of copying them (CopyDrawInput). The GPU reads that imported memory far more slowly than memory the driver allocates. The snapshots are host-visible system memory as well, so the slowdown is specific to imports, not to PCIe in general.Evidence:
APS5_NO_HOST_IMPORT=1CopyDrawInput's reusable snapshots (kept until write-watch sees a write)With the snapshot change the image is correct both in gameplay and in the intro cutscene, and the intro cutscene goes from 5.76 to 7.99 FPS.
Related: #5345 (the CPU side of the same scene: the single queue worker), #5692 (Windows direct host imports, CPU cost of comparing them), #3338 (why huge inputs must not be copied per draw; the fix keeps
DrawInputBudget).Fix proposed in a upcoming PR.
A/B on the same machine and scene, 3 interleaved runs per side, base =
maina0f5916a2+ the local changes RDR needs to start:The GPU time drops by 58%. Frame time does not move on this base, because the queue worker is CPU-bound at ~99% (#5345). On a base where the GPU is the limit (the same tree plus #494/#1193/#1202/#5216), the same change takes gameplay from 3.07 to 4.40 FPS.
Summary lines
Traces
fix-1-aps5-trace-56552cf22f3b-36792.json.gz
fix-2-aps5-trace-56552cf22f3b-25704.json.gz
fix-3-aps5-trace-56552cf22f3b-20876.json.gz
Digest
seconds 84:5 from present 1804: 12 presents, frame p50 467.3 / p90 479.0 / p99 480.1 / max 480.1 ms, GPU busy 301.5 ms per present
NVIDIA GeForce RTX 4070 SUPER, NVIDIA 616.64, Windows 10.0.26200, 3840x2160, commit b3fecb970208, dropped: yes
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 281.5, Driver.Packet.draw 272.9, Driver.Draw 271.6, batch 265.2, Driver.Draw.draw_and_resource_release 127.0, Graphics.Draw 125.7, Graphics.Draw.draw_and_resource_release 100.9, Driver.Draw.shader_compile_and_link 72.6, Driver.Present 51.8, Driver.Present.render_fence_wait 51.2
Longest waits
Worker stacks
No response
Capture
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T10:41:52Z.
An AMD iGPU data point for #6763's per-driver choice. AMD's Windows driver on an APU reads draw inputs in place about as fast as from copies, as SoRadGaming measured on the RX 9070 XT. So binding in place on AMD holds for iGPUs too.
Setup: Radeon 860M (RDNA 3.5,
1002:1114, driver 32.0.13058.8001, 512 MiB UMA carve-out, so the copies also land in host memory), Windows 11 26300,main1381826358. SuperTuxKart (PPSA69421) tutorial race, three alternating pairs withAPS5_PROFILE_GPU=1andAPS5_TRACE_SECONDS=95:20: default (in place) againstAPS5_NO_DRAW_INPUTS_IN_PLACE=1(copied).drawis the[gputime]class summed over the last four 10 s windows of each run, divided by their presents:drawGPU ms/presentdrawGPU ms/presentThe first copied run is an outlier across the whole GPU (108 ms busy against about 70 ms in every other run). Its
shadow-publishandstorage-writebackclasses rose withdraw, so I don't attribute it to the copies. Rounds 2 and 3 are within 1–2 ms per present.