vk: batched submits: a progress poll flushes only after 2 ms by default #689

Merged
azlekayn merged 1 commit from fix/radv-batch-poll-default into main 2026-11-09 04:59:40 +00:00
azlekayn commented 2026-11-08 17:13:40 +00:00 (Migrated from github.com)

What this fixes

With RX_VK_BATCH on (the default on RADV), get_replayed() sends the held submits on every progress poll, because RX_VK_BATCH_POLL_US defaults to 0. The game polls many times a frame, so most flushes come from polls, and each one is a full command submission. That is the cost batching exists to avoid.

This makes the default 2000 µs, as suggested in #413 and #528. A poll then flushes only once the oldest held submit has waited 2 ms. RX_VK_BATCH_POLL_US=0 restores the old behaviour. Flushes for waits, values, slots and presents are unchanged, so held work is delayed by at most 2 ms on the poll path.

Measured

RX 7800 XT, RADV, Kokiri Forest, Link idle on the balcony at about 2150 draws. 60 s per run, 2 runs per setting, on one build with the settings interleaved.

RX_VK_BATCH_POLL_US fps poll flushes per 120 presents big flashes
0 (old default) 38.5, 37.6 525 0, 0
2000 (new default) 42.2, 43.1 67 0, 0

An earlier sweep on 7e9bf73 + #448 was flat from 1 to 16 ms: 41.4 to 43.7 fps against 37.1 and 37.3 for 0.

Not covered

  • The build was current main (5c9b0bf) + #448, because main alone falls back to very low fps on this card. The renderer was swapped into a game built from 7e9bf73.
  • Only one card and one scene were measured. Other RADV reports (#413 on a Radeon 8060S, #528 on an RX 9060 XT) saw the same effect with this setting set by hand.
  • Non-RADV drivers only reach this path with RX_VK_BATCH=1.

🤖 Generated with Claude Code

## What this fixes With `RX_VK_BATCH` on (the default on RADV), `get_replayed()` sends the held submits on every progress poll, because `RX_VK_BATCH_POLL_US` defaults to 0. The game polls many times a frame, so most flushes come from polls, and each one is a full command submission. That is the cost batching exists to avoid. This makes the default 2000 µs, as suggested in #413 and #528. A poll then flushes only once the oldest held submit has waited 2 ms. `RX_VK_BATCH_POLL_US=0` restores the old behaviour. Flushes for waits, values, slots and presents are unchanged, so held work is delayed by at most 2 ms on the poll path. ## Measured RX 7800 XT, RADV, Kokiri Forest, Link idle on the balcony at about 2150 draws. 60 s per run, 2 runs per setting, on one build with the settings interleaved. | `RX_VK_BATCH_POLL_US` | fps | poll flushes per 120 presents | big flashes | |---|---|---|---| | 0 (old default) | 38.5, 37.6 | 525 | 0, 0 | | 2000 (new default) | 42.2, 43.1 | 67 | 0, 0 | An earlier sweep on 7e9bf73 + #448 was flat from 1 to 16 ms: 41.4 to 43.7 fps against 37.1 and 37.3 for 0. ## Not covered - The build was current main (5c9b0bf) + #448, because main alone falls back to very low fps on this card. The renderer was swapped into a game built from 7e9bf73. - Only one card and one scene were measured. Other RADV reports (#413 on a Radeon 8060S, #528 on an RX 9060 XT) saw the same effect with this setting set by hand. - Non-RADV drivers only reach this path with `RX_VK_BATCH=1`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Commenting is not possible because the repository is archived.
No description provided.