The title's own 30 fps cap: a target-fps value it turns into its frame interval and enforces with a CPU limiter (60.0 fps with it set to 60) #2469
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2469
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?
@thegl0w on GitHub · 2026-11-25 14:15 UTC · original
Short version
1,000,000 / fps, so 33,333). The same value is what it passes toSetFrameIntervalX.QueryPerformanceCounter: it sleeps in short steps while more than about 2 ms remain, then spins.Where it is (image-relative offsets)
QueryPerformanceCounter)+0x120600, its sleep at+0x12073e+0x98f84ac1,000,000 / fps; 0 or values of 1,000 and up are clamped to 1,000)+0x1e0fc94and+0x22435ce+0x210of the object both functions receive+0x2470eefThe limiter rounds the rate to a whole number before computing its period, so the target-fps value, not the microsecond interval, decides the period: 30 gives 33.3 ms and 60 gives 16.7 ms.
How it was found
VICTORY_STACKSevery second through that 30 fps phase (35 samples). The thread that paces the frame was in the title's limiter sleep (+0x12073e) in 17 of 19 samples.title-mainwaits on that thread through the function at+0x23cf6a0, the one with the watchdog from #1118. It was polling in that wait in 12 of 35 samples.Frame rate during story loading (5 s averages from the layer's log)
What this means for later
Setup
fxceless/victory-forkata253706, diagnostics build, plus three local test switches (uncapped layer pacing, reported refresh rate, code patch). None of them is proposed here.No game data in this report: no disassembly, no code bytes, no shaders or dumps.
@thegl0w on GitHub · 2026-11-25 15:07 UTC · original
Follow-up: the title's time step is clamped to between 1/30 and 1/15 s, so it runs slow below 15 fps and fast above 30
Lifting the fps cap above isn't enough on its own. The title's frame time step has a floor of 1/30 s, so at 60 fps the game runs at about double speed. The same clamp has a ceiling of 1/15 s, which is why every build in the world today runs in slow motion.
What the title does
+0xabbef4c, the time step in seconds of a timer structure at+0xabbef40. Its inverse is at+0x14of that structure. It's read as a float in about 1,190 places, far more than any other global. Several other timer structures share this layout; only this one was measured.+0x2226040) takes the measured frame time, the time scale and a clamp flag. With clamping on:+0x7453cc0: either the value at+0x6849844(live: 1/30 s) or a small one at+0x6847660(live: 1/3000 s). The flag was 1, so the 1/30 floor applied, in the menus, story loading and the world.+0x2226130) sets these timers to 0.05 s before the first update.Measured, by reading the title's memory while it ran (read-only)
01aadd1, RTX 3070)a253706)So:
A note for anyone measuring the same way
Querying the title's window title from another process twice a second (to log the fps shown there) set off the title's watchdog at
+0x2215c35within about 30 s in two runs out of two. The same runs without that query, reading memory only, were fine.@thegl0w on GitHub · 2026-11-25 15:24 UTC · original
Follow-up 2: one value sets both the cap and the floor; with it at 60, game time tracks real time
The time-step floor from the comment above is not a separate constant. It's
1 / target fps, taken from the same target-fps field (+0x210of the settings object) as the frame interval:+0x2241fd0returns the title's target frame rate. If the target-fps field is non-zero, it returns that. If the field is 0, it derives a rate from the display instead: the refresh rate (two globals at+0xa9438d4/+0xa9438d8) divided by a swap interval at+0x214of the same object, or 30 when that is 0 or the result isn't positive.+0x2243560…+0x22435fccomputes the frame interval from the field (+0x22435ce, see the first report), then sets the floor to1 /that rate (+0x22435ea).The earlier 60 fps test changed only the two interval setters' reads of the field, so the floor stayed at 1/30 and the game ran at double speed. With the field read as 60 at all three reads (the two setters and the rate function; still a local test patch, not proposed here):
+0x6849844So one value, the target-fps field, decides the title's frame cap, its limiter and its time-step floor. Set to 60 everywhere it's read, the title paces itself at 60 and its game time follows real time. The 1/15 s ceiling (slow motion below 15 fps) is unchanged.
The field-is-0 path, also tested (the two setters see 0 and the rate function takes its display branch; local test patch):
So if a situation on real hardware ever leaves the target-fps field at 0, the frame rate is uncapped but the game runs fast in proportion. That's a testable prediction for any report of an "uncapped" console version: the game should visibly speed up above 30 fps.
Where the refresh value comes from, and a 120 Hz table:
+0x2481ca0…+0x2481e2f) the title asks the display output for its mode list (output method0xa8, the one the layer answers indxgi.rs) and looks for a mode with a refresh of exactly 120. If one exists it sets a flag (+0x760e660) and stores a refresh of 120/1, otherwise 60/1 (the globals at+0xa9438d4/+0xa9438d8). A 240 Hz-only mode list doesn't count.+0x247ab10…) computes a swap interval asrefresh ÷ desired fps(at most 4), then looks up the frame interval in a table at+0x61ece60with one row per refresh:So the title's frame pacing is built for 120 Hz output, including a 40 fps interval (the usual 120 Hz "balanced" rate). Whether the retail game ever sets the target-fps field above 30 isn't known; this only shows the pacing code supports it.
Tested end to end: a 120 Hz mode reported (local layer switch) and the target-fps field read as 40 at all three reads: frame interval 25,000 µs, refresh 120/1 with the 120 Hz flag set, floor 0.025 s (1/40), a steady 40.0 fps (25.0 ms) through story loading, and a time step of 0.0250 s at 25 ms frames (15 of 30 samples; the rest were heavier frames, also matching real time). So a 40 fps mode runs at the correct game speed too.
What's left open:
@kotekompotek on GitHub · 2026-11-25 17:08 UTC · original
One data point that connects this to the layer: the title's 120 Hz path is gated by the display mode list, and our
modesanswer (victory-gpu/src/dxgi.rs) returns a fixed single mode — 4K at 60/1 — with a comment already noting "Grand Theft Auto VI looks for a 120 Hz one to allow 120 Hz frame intervals" (marked as a shortcut to revisit). So today the title's+0x760e660flag can never set on this layer, and the display-derived globals always read 60/1.That makes the field-0 fallback the relevant one: it returns
refresh ÷ swap = 60/0 -> 30— which happens to be the console-correct cap anyway. But your measured 40 fps path (25,000 µs interval, floor 1/40, correct game speed) is exactly what reporting a 120 Hz mode would unlock without any title patching — a config/env knob on the mode list (VICTORY_DISPLAY_HZ=120) is all that's between "field stays 30" and "field can take 40". If experiments with >30 fps pacing ever become useful for perf headroom testing, that's the cheapest legitimate switch — the pacing math your report documents does the rest.@Marvisak on GitHub · 2026-11-25 18:50 UTC · original
Automated triage for the maintainers.
These measurements were made on another tree (
fxceless/victory-fork) with local patches to the title. The part that concerns our code checks out against main. Incrates/victory-gpu/src/dxgi.rs,modesreports one fixed 4K 60 Hz mode. Ashortcut:comment there notes that the title looks for a 120 Hz mode. So the title's 120 Hz pacing path is never offered by this layer, and the title stays at its own 30 fps target.The finding that matters for the project's current state is the second comment: the title clamps its time step to at most 1/15 s. That explains why runs in the world at about 1 fps play in slow motion while audio runs in real time.
An option for a frame-rate target fits the scope (Windows, this title). It would need the title's target value changed consistently, not only the layer's pacing, and gameplay speed above 30 fps checked once the world runs that fast. Kept open as a request. Any patch to the title has to be done in our runtime, and must not ship or post title code.
Generated by Claude Code