RX_VK_CAPTURE_WAIT=0 takes OoT from ~31 to 60 fps on an RTX 3080 (late-page wait every frame) #2655

Open
opened 2026-11-12 04:28:24 +00:00 by bigdjr · 2 comments
bigdjr commented 2026-11-12 04:28:24 +00:00 (Migrated from github.com)

Hookshot version

v2.1.0

What kind of problem

Low fps or stutter

What happened

Setup

  • Hookshot v2.1.0 (source 633eb435)
  • The Legend of Zelda: Ocarina of Time
  • NVIDIA GeForce RTX 3080 10 GB, driver 0x9b404000
  • Windows 10 Pro 22H2, 64 GB RAM

Problem
In heavy areas the game drops from 60 fps to 31-34 fps. The log shows the replay waiting for the GPU on one capture every frame:

a capture taken (ms): all 1.973; GPU wait for late pages 1.957 (100 of 600 takes)
a frame's replay time (ms): submit ~20-24, memory sync ~10

In areas running at 60 fps it's 0-1 of 600 takes, memory sync ~0.9 ms and submit ~10 ms. GPU-bound wait is ~0, so the GPU isn't the limit. The CPU and GPU end up taking turns.

RX_VK_CAPTURE_WAIT results

  • Default (2): 31-34 fps in heavy areas, no artifacts
  • 1: no flicker, but 33-45 fps in Hyrule Field (close to the 35-45 noted in the code comment for issue 995)
  • 0: 57-60 fps, 0 of 600 takes, memory sync ~0.9 ms, but black flickering, e.g. a background mountain, during dialogue and during gameplay

Likely cause
The exposure-meter late-page wait in take_capture (gpu/vk/vk_memory.cpp) serializes the CPU and GPU once a frame. Could the late pages' copy be done on the GPU after the write-back lands (in queue order) instead of on the CPU after a timeline wait? That would avoid both the stall and the stale data.

Log from a session with the slowdown attached (hookshot_log.4.txt).

Where in the game

Hyrule Field

How often

Every time

Graphics card and driver version

NVIDIA GeForce RTX 3080 10 GB, driver 0x9b404000

CPU, RAM and operating system

Windows 10 Pro 22H2, 64 GB RAM

Changes from the defaults

No response

Other software hooked into the game

No, nothing hooked in

hookshot_log.txt

hookshot_log.4.txt

Screenshots or video

No response

Before you send it

  • I'm on the newest release, or the problem is still there on it.
  • I searched the open issues for this problem.
  • I'm not attaching game files, keys, hookshot.exe, the .bin caches or saves.
### Hookshot version v2.1.0 ### What kind of problem Low fps or stutter ### What happened **Setup** - Hookshot v2.1.0 (source 633eb435) - The Legend of Zelda: Ocarina of Time - NVIDIA GeForce RTX 3080 10 GB, driver 0x9b404000 - Windows 10 Pro 22H2, 64 GB RAM **Problem** In heavy areas the game drops from 60 fps to 31-34 fps. The log shows the replay waiting for the GPU on one capture every frame: a capture taken (ms): all 1.973; GPU wait for late pages 1.957 (100 of 600 takes) a frame's replay time (ms): submit ~20-24, memory sync ~10 In areas running at 60 fps it's 0-1 of 600 takes, memory sync ~0.9 ms and submit ~10 ms. GPU-bound wait is ~0, so the GPU isn't the limit. The CPU and GPU end up taking turns. **RX_VK_CAPTURE_WAIT results** - Default (2): 31-34 fps in heavy areas, no artifacts - 1: no flicker, but 33-45 fps in Hyrule Field (close to the 35-45 noted in the code comment for issue 995) - 0: 57-60 fps, 0 of 600 takes, memory sync ~0.9 ms, but black flickering, e.g. a background mountain, during dialogue and during gameplay **Likely cause** The exposure-meter late-page wait in take_capture (gpu/vk/vk_memory.cpp) serializes the CPU and GPU once a frame. Could the late pages' copy be done on the GPU after the write-back lands (in queue order) instead of on the CPU after a timeline wait? That would avoid both the stall and the stale data. Log from a session with the slowdown attached (hookshot_log.4.txt). ### Where in the game Hyrule Field ### How often Every time ### Graphics card and driver version NVIDIA GeForce RTX 3080 10 GB, driver 0x9b404000 ### CPU, RAM and operating system Windows 10 Pro 22H2, 64 GB RAM ### Changes from the defaults _No response_ ### Other software hooked into the game No, nothing hooked in ### hookshot_log.txt [hookshot_log.4.txt](https://github.com/user-attachments/files/34728698/hookshot_log.4.txt) ### Screenshots or video _No response_ ### Before you send it - [x] I'm on the newest release, or the problem is still there on it. - [x] I searched the open issues for this problem. - [x] I'm not attaching game files, keys, hookshot.exe, the .bin caches or saves.
Owner

@blushOFF commented on GitHub · 2026-11-12 10:09 UTC · original

I tried the GPU-side copy suggested here, and in its simple form it flashes. Notes, so nobody has to repeat it.

What I tried (branch on main ba005ca4, not opened as a PR): capture_make still finds the late pages, but leaves them out of the capture's copy and does not wait. With no capture entry, mirror_sync copies those pages live from guest memory into the mirror (p.buffer to p.mirror). That copy runs in the upload command buffer, after its full_barrier, so the write-back that came before has landed by then.

Result (Windows 11, RTX 3070 8 GB, Kokiri Forest, Hyrule Field and the Market, 4 runs of each, alternated):

  • The replay no longer waits: 0 of 600 takes, against 6-30 of 600 with RX_VK_CAPTURE_WAIT=2.
  • In one of 4 runs, the Market had 2 full-screen white flashes: the exposure blew out for a frame. The 4 runs with the wait had none.
  • Market fps did not improve on this card: 46.7 / 48.0 / 48.3 against 53.5 / 43.8 / 51.4 / 46.0 with the wait. The first run, just after the build, was left out.

My reading: a live copy reads guest memory when the GPU gets there, not as it was at the capture. The CPU runs ahead and has by then written the exposure page for a later frame, so the GPU adds into the wrong sums. So the copy needs the capture's CPU bytes merged over the landed write-back (word by word, against the write-back diff's shadow), not the page as it is at that point. That is a bigger change, and I have not tried it.

Also: on this card with default settings, the wait is rare (6-30 of 600 takes), and RX_VK_CAPTURE_WAIT=0 gave no fps gain at the Market either (50.8 / 50.6 against 51.6 / 47.2). The every-frame wait in this issue probably needs the game to run ahead of the GPU, as on your 3080.

> [@blushOFF](https://github.com/blushOFF) commented on GitHub · 2026-11-12 10:09 UTC · [original](https://github.com/NotRexed/Hookshot/issues/2655#issuecomment-6820733465) I tried the GPU-side copy suggested here, and in its simple form it flashes. Notes, so nobody has to repeat it. **What I tried** (branch on `main` ba005ca4, not opened as a PR): `capture_make` still finds the late pages, but leaves them out of the capture's copy and does not wait. With no capture entry, `mirror_sync` copies those pages live from guest memory into the mirror (`p.buffer` to `p.mirror`). That copy runs in the upload command buffer, after its `full_barrier`, so the write-back that came before has landed by then. **Result** (Windows 11, RTX 3070 8 GB, Kokiri Forest, Hyrule Field and the Market, 4 runs of each, alternated): - The replay no longer waits: 0 of 600 takes, against 6-30 of 600 with `RX_VK_CAPTURE_WAIT=2`. - In one of 4 runs, the Market had 2 full-screen white flashes: the exposure blew out for a frame. The 4 runs with the wait had none. - Market fps did not improve on this card: 46.7 / 48.0 / 48.3 against 53.5 / 43.8 / 51.4 / 46.0 with the wait. The first run, just after the build, was left out. My reading: a live copy reads guest memory when the GPU gets there, not as it was at the capture. The CPU runs ahead and has by then written the exposure page for a later frame, so the GPU adds into the wrong sums. So the copy needs the capture's CPU bytes merged over the landed write-back (word by word, against the write-back diff's shadow), not the page as it is at that point. That is a bigger change, and I have not tried it. Also: on this card with default settings, the wait is rare (6-30 of 600 takes), and `RX_VK_CAPTURE_WAIT=0` gave no fps gain at the Market either (50.8 / 50.6 against 51.6 / 47.2). The every-frame wait in this issue probably needs the game to run ahead of the GPU, as on your 3080. <!-- github-sync:c:6820733465 -->
Owner

@mooki000 commented on GitHub · 2026-11-12 14:12 UTC · original

The attached hookshot_log.4.txt contains only shader preparation followed by a normal close; it does not include the gameplay capture-wait lines quoted above. Could you attach the log from the slow gameplay session? Please keep the normal capture-wait setting for that run; disabling it can produce the flashes already reported here.

> [@mooki000](https://github.com/mooki000) commented on GitHub · 2026-11-12 14:12 UTC · [original](https://github.com/NotRexed/Hookshot/issues/2655#issuecomment-6825953658) The attached `hookshot_log.4.txt` contains only shader preparation followed by a normal close; it does not include the gameplay capture-wait lines quoted above. Could you attach the log from the slow gameplay session? Please keep the normal capture-wait setting for that run; disabling it can produce the flashes already reported here. <!-- github-sync:c:6825953658 -->
Commenting is not possible because the repository is archived.
No milestone
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Hookshot#2655
No description provided.