Skip to content

games: Red Dead Redemption (01007820196A6000) 60 fps through sm_FrameLock (Depends on: #1801, #1945) - #1948

Draft
tapionallanaire wants to merge 12 commits into
igawa6:devfrom
tapionallanaire:pr/rdr-60fps
Draft

tapionallanaire wants to merge 12 commits into
igawa6:devfrom
tapionallanaire:pr/rdr-60fps

Conversation

@tapionallanaire

Copy link
Copy Markdown
Collaborator

What and why

Depends on: #1801 (this branch is stacked on it: the first 8 commits are #1801's; this PR adds the last 4)
Depends on: #1945
Depends on: #1738 (through #1801)

Red Dead Redemption (01007820196A6000, 1.0.7, main 37531419da76) at 60 fps: a reviewed FPSLocker row and present_interval display, profile only.

  • The game steps by measured time. RAGE's TIME::Update (main+0x1b4190) takes the system tick delta since the last frame, times the time scale, clamped to 0.0001-0.1 s, and adds it to the game time; its fixed 1/60 s branches need flags or a command-line parameter a retail start does not set. Physics picks its substeps from the measured step. So present_interval display is right for it.
  • The cap is rage::grcDevice::sm_FrameLock (main+0x20dba20): main+0xbd9618 sets it to 2 at start, the NVN window takes it as its present interval, and the engine keeps its own 60 fps path on it (dynamic resolution's GPU target 15.71 ms instead of 31.42 ms, a frame-time scale, Scaleform's UI sync, the scripts' fs_GetIs30FPS).
  • The row fpslocker 37531419da7654ec3f5b586693f7f331 vsync_u32 @0x20dba20 1 0 writes 60 / the limit there (1 at 60, 2 at 30, the game's own value), from masagrator's FPSLocker Warehouse config for this build (patches/01007820196A6000/37531419DA7654EC.yaml, ALL_FPS). Its other part, a hook on the dynamic-resolution target, is left out: at 30 and 60 the game computes the same targets itself.
  • fps_limit 60, fps_modes 30,60: every reader tells 2 from the rest, so 20 (a value of 3) would take the 60 fps paths; Game owned writes nothing.
  • The README's Frame rate section lists what still counts frames at 60: 11 of 130 readers of the frame counter compare a frame difference with a constant (staleness checks, a 60-frame and a 301-frame window, a HUD challenge counter), and two fixed 1/30 s steps remain (rage::fragInst's force-to-impulse for its breaking check, rdr2::CutsAnimMgrEntity). Nothing wrong was seen from them in play.
  • docs/agents/game-patches.md from docs_patches.py.

Why #1945: without it, the audio follower reads the game's pace from presented frames at 1/60 s each, and a device that does not hold 60 makes the sound lead the picture (Thor at 46 to 55 fps: median 188 ms, up to 392 ms, 28 underruns in 16 minutes). With it, the sound keeps real time as the game does. Without #1738, hitched horses, people and props are culled while in view (the game never resets its SAMPLES_PASSED counter); #1801's note covers that.

Impact on other profiles

Profile only: dm/games/01007820196A6000/ and the generated docs/agents/game-patches.md. No shared code, no new key; the row's build gate matches only this main. No table, extension, magic or key collision. The new rows in game-patches.md are this game's.

Checked

Docs

An RPF6 archive's table of contents and name table are encrypted, but its
members are plain zstd frames. The split now finds the members whose first
bytes are 'rgxd' and takes each GLSLC output record in them
({0x19866891, code size, control size, code, control}). Only files that
start with 'RPF6' reach the new branch; no other profile has one.

Red Dead Redemption's shaders.rpf: 131 effects, 3,413 programs
(2,089 vertex, 1,324 pixel), all unique.
The update package holds the whole game. Profile from the NSP script's
survey; shader tables from the split: 3,581 shaders (3,413 from
shaders.rpf, 168 that main embeds). Not yet run on a device.
…embers)

Red Dead Redemption's first screen (the language select before the boot,
d11extra/langselect.pkdswitch) draws with a vertex and pixel shader that
are whole GLSLC outputs inside the pack's zlib members. The split did not
read the pack, so both were missing from the library and the screen
stayed black. Only files named .pkdswitch with the pack's header are read.
Regenerate shader_map.tsv and shader_pairs.tsv with the current split:
group names follow the split's (vs_effects, ps_effects, vs_main, ps_main),
which the on-device Prepare compares against, and the two shaders of
d11extra/langselect.pkdswitch are added (3,583 shaders).
… 512.800

The opening crashes in vkResetCommandBuffer on Qualcomm 512.676 (Adreno 740)
with push descriptors, in 6 of 6 runs; without them it plays past that shot.
Turnip and newer Qualcomm drivers keep push descriptors.
The opening and about 11 minutes of play on Qualcomm 512.676 (Adreno 740)
with push_desc_qcom_old off: 30 fps, no underruns in play. The crash and
what was ruled out are in the README.
The build row names the display version the app shows (1.0.7), zip_store
drops .metallib (not used on Android), and the note's Open list names the
Qualcomm driver crash the profile works around and the culling the game
shows without cumulative SAMPLES_PASSED counting (igawa6#1738).
docs/agents/game-patches.md regenerated with docs_patches.py.
RAGE steps the game by measured time (TIME::Update, clamped to 0.0001-0.1 s),
and the 30 fps cap is sm_FrameLock (main+0x20dba20), which the game sets to 2
at start and also reads for its own 60 fps paths (dynamic resolution target,
frame-time scale, UI sync, scripts). One reviewed fpslocker vsync_u32 row
writes 60 / the cap there (FPSLocker Warehouse ALL_FPS for this build), with
present_interval display. Game owned, 30 and 60 only: 20 would give 3, which
every reader treats as 60.
The frame counter's readers, the frame-difference windows that halve at 60,
the two fixed 1/30 s steps left (fragInst force notification, cutscene
animation manager) and fs_GetIs30FPS.
dm/tools/docs_patches.py after the profile's present_interval display, fps_limit 60 and fps_modes 30,60.
…wer needs

Tested on: 18.2 min at the 60 limit (median 57.9 fps, game time 0.994 of real time) and 12.3 min at 30 on Turnip 27.0.0-R2, with igawa6#1738 and igawa6#1945. Frame rate: why igawa6#1945 is needed. Open: Qualcomm at 60, lip sync by ear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant