vk: capture copies: four helpers from 12 CPU threads #876

Merged
azlekayn merged 1 commit from perf/capture-helpers-by-cores into main 2026-11-09 08:47:09 +00:00
azlekayn commented 2026-11-08 23:54:15 +00:00 (Migrated from github.com)

A capture's page copies run on the game's main thread, and it blocks until they finish. On machines with 12 or more CPU threads, this change uses four copy helpers instead of two. Below 12 threads nothing changes, and RX_VK_CAPTURE_THREADS and RX_VK_LOW_SPEC still override it.

Sampling all threads every 2 ms at a ~2150-draw scene, the copies are about 6% of the main thread's time.

Measurements

Ryzen 7 7800X3D (16 threads), RX 7800 XT, RADV, Fedora 44, 2560x1440. Game at the same ~2150-draw spot in each run (40-45 s windows):

RX_VK_CAPTURE_THREADS fps per run mean
unset (2) 40.8, 44.1, 41.8, 41.9, 42.8, 39.2, 42.5 41.9
4 44.5, 44.0, 43.0, 43.6, 41.4, 43.0 43.3

That is about +1.4 fps (3%). Run-to-run spread is about as large as the gain, so treat it as a small improvement. No big flashes in any run, by our frame-difference check.

What was and wasn't tested

  • The runs used the existing RX_VK_CAPTURE_THREADS=4 setting on 5c9b0bf plus #448 and #689.
  • This branch compiles on current main (Linux, renderer), but I did not run this exact build.
  • Only one CPU was tested, so the 12-thread cutoff is a judgement call: it leaves spare threads for the game. Not tested on Windows, or on CPUs with fewer threads, where behaviour is unchanged.

🤖 Generated with Claude Code

A capture's page copies run on the game's main thread, and it blocks until they finish. On machines with 12 or more CPU threads, this change uses four copy helpers instead of two. Below 12 threads nothing changes, and `RX_VK_CAPTURE_THREADS` and `RX_VK_LOW_SPEC` still override it. Sampling all threads every 2 ms at a ~2150-draw scene, the copies are about 6% of the main thread's time. ## Measurements Ryzen 7 7800X3D (16 threads), RX 7800 XT, RADV, Fedora 44, 2560x1440. Game at the same ~2150-draw spot in each run (40-45 s windows): | `RX_VK_CAPTURE_THREADS` | fps per run | mean | |---|---|---| | unset (2) | 40.8, 44.1, 41.8, 41.9, 42.8, 39.2, 42.5 | 41.9 | | 4 | 44.5, 44.0, 43.0, 43.6, 41.4, 43.0 | 43.3 | That is about +1.4 fps (3%). Run-to-run spread is about as large as the gain, so treat it as a small improvement. No big flashes in any run, by our frame-difference check. ## What was and wasn't tested - The runs used the existing `RX_VK_CAPTURE_THREADS=4` setting on 5c9b0bf plus #448 and #689. - This branch compiles on current main (Linux, renderer), but I did not run this exact build. - Only one CPU was tested, so the 12-thread cutoff is a judgement call: it leaves spare threads for the game. Not tested on Windows, or on CPUs with fewer threads, where behaviour is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Commenting is not possible because the repository is archived.
No description provided.