Skip to content

Batman: Arkham Knight on Android: Turnip road fixes (tile pass one lane, road markings flush, decal blinking) - #657

Open
tapionallanaire wants to merge 11 commits into
igawa6:mainfrom
tapionallanaire:pr/batman-android
Open

tapionallanaire wants to merge 11 commits into
igawa6:mainfrom
tapionallanaire:pr/batman-android

Conversation

@tapionallanaire

Copy link
Copy Markdown
Contributor

Batman: Arkham Knight 1.0.5 on Android, with fixes for three Turnip rendering problems on roads. Played on a Galaxy S24 Ultra (Adreno 750, Turnip Gen8 V39) in the Peanuts app: Prepare from a .nup of 1.0.5, the opening, and Gotham's streets with clean road markings at 30 fps.

Changes

  • Game list: Batman joins nxGames, with a readiness.tsv status row (bring-up) and an Android section in its README.
  • Grey 16-pixel squares on roads and kerbs (DM_VK_ONE_LANE, recommended on driver.id=18). The tile pass (compute 752e5bf8b7496d94) and its helper (da62b52f4641ad83) give wrong per-tile results with 64-lane subgroups on Turnip. subgroup_one_lane rows run their subgroup operations as one-invocation subgroups. They apply on Qualcomm's driver by default, and the option enables them on any driver.
  • Dark stair-stepped 16-pixel blocks over road markings and decals (DM_VK_TU_FLUSHALL, recommended on Turnip).
    • Cause: the road decals (pixel shader 103569496bd29d04 and five more) read the depth the G-buffer pass's earlier draws wrote. At that point Turnip had written it only in some 16-pixel tiles.
    • Fix: TU_DEBUG=flushall draws them clean at the same 30 fps. The launcher adds that line for the option (GameActivity), because Turnip reads TU_DEBUG only once, at the first Vulkan device of the process. An env.txt TU_DEBUG line still wins. Device creation logs DM_VK_TU_FLUSHALL: TU_DEBUG=… so the option can be checked in a game's log.
    • Ruled out: syncdraw alone, LRZ / sysmem / UBWC off, a full barrier before the decals, the depth test off for them, and the decal shaders' NaN guards, kills and mip level. The exact missing flush isn't narrowed down yet; until it is, this option is the workaround.
  • Road decals switching on and off with the camera still (DM_VK_NO_OCCLUSION, recommended on Turnip).
    • Cause: the game hides a decal while its samples-passed report reads 0, and on Turnip about 9.5 of the 10.7 reports a frame read 0 samples.
    • Fix: with every report written 1 (DM_VK_OCCLUSION=0) the decals stay drawn, at the same 30 fps. The option is that switch as a KEY=1 line; DM_VK_OCCLUSION, when set, still wins.
  • Prewarm seed: vk_prewarm.bin merges the pipeline keys of a Turnip Gen8 V39 run (1762 keys) and a Turnip v27 run (1369), 1771 in all. Without it, objects and their shadows were skipped for the first minutes in new places while their pipelines were built.
  • Switch table: rows in docs/env_switches.tsv for the two new switches.

Checks

  • test_android_games, test_android_profile_options, test_env_switches, test_option_patch, test_android_readiness and peanuts/tests/test_issue_forms.py pass.
  • games_catalog.py reports nothing to write.
  • peanuts/tests as a whole: the same failures as main 4ae5c26 (34 failures, 7 errors on this Windows host), none new.
  • test_docs fails the same way on main.
  • Each option is a restart option. They change nothing unless enabled, and are recommended only on driver.id=18.

… in its note

- android/app/gradle.properties: 0100ACD0163D0000 in nxGames.
- The note: Prepare and the opening on a Galaxy S24 Ultra with Turnip Gen8
  V39 at 30 fps; the 1.0.5 update is a whole-game patch over a stub base.
…as one lane

Light-grey 16-pixel squares on roads and kerbs (the wet layer missing tile by
tile) on a Galaxy S24 Ultra with Turnip Gen8 V39: the tile pass 752e5bf8b7496d94
and its helper da62b52f4641ad83 give wrong per-tile results there. As
one-invocation subgroups they draw clean. subgroup_one_lane rows, the
DM_VK_ONE_LANE option, recommended on Turnip (driver.id=18).
… fix)

Dark stair-stepped 16-pixel blocks over the road markings on Turnip, changing as
the view moves (S24 Ultra, Turnip Gen8 V39; Odin 2, Turnip v27). The road decals
of the G-buffer pass reconstruct their position from the depth the pass's earlier
draws wrote; painted from inside the decal, that depth held the road only in some
16-pixel tiles, while the lighting pass later read it whole. Ending the pass with
a full barrier before the decals did not change it; TU_DEBUG=flushall did, at the
same 30 fps (syncdraw alone did not).

A game option DM_VK_TU_FLUSHALL ("Road markings fix"), recommended on Turnip:
the launcher passes TU_DEBUG=flushall with it, since Turnip reads TU_DEBUG once at
the first Vulkan device of the process (the readiness check's). Other drivers
ignore it. Replaces the reverted skip_layers rows, which dropped two decals and
left the others' blocks.
…g fix)

The game hides road decals while their samples-passed reports read 0; on Turnip about
9 of 11 reports a frame read 0 and the markings switch on and off with the camera still.
A DM_VK_NO_OCCLUSION option (DM_VK_OCCLUSION=0) keeps them drawn; recommended on Turnip.
…ce log says what TU_DEBUG Turnip got

readiness.tsv (status bring-up) puts the profile in nxGames (test_android_games).
docs/env_switches.tsv rows for DM_VK_NO_OCCLUSION and DM_VK_TU_FLUSHALL; the device
creation logs 'DM_VK_TU_FLUSHALL: TU_DEBUG=...' on Turnip, so the option can be checked
in a game's log.
…ory too (dark squares on an Adreno 740)

On an Odin 2 (Adreno 740, Turnip v27.0.0-R1 and Gen8 V39) TU_DEBUG=flushall alone left
dark 16-pixel squares on roads that blink between frames; TU_DEBUG=flushall,sysmem clears
them. DM_VK_TU_FLUSHALL now sets both.
@tapionallanaire

Copy link
Copy Markdown
Contributor Author

Update: on an Adreno 740 (Odin 2, Turnip v27.0.0-R1 and Gen8 V39), TU_DEBUG=flushall alone still left dark 16-pixel squares on roads that blink between frames. Skipping the decal pixel shaders, the tile pass or the other compute passes, or adding barriers, did not remove them; TU_DEBUG=flushall,sysmem (no tile memory) does. DM_VK_TU_FLUSHALL now sets TU_DEBUG=flushall,sysmem (d8e194a, plus the switch table and README).

…BWC (squares at a crossing on an Adreno 740)
@tapionallanaire

Copy link
Copy Markdown
Contributor Author

Further update: TU_DEBUG=flushall,sysmem cleared one street on the Adreno 740 but dark squares remained at a yellow-grid crossing. TU_DEBUG=flushall,sysmem,nolrz,noubwc clears both at 30 fps (GPU p50 about 24.5 ms at 1080p docked). DM_VK_TU_FLUSHALL now sets all four.

…wned recommended

The game's 30 is its window's present interval 2 (main+0xb6ce70). Its engine
limit, UGameEngine::GetMaxTickRate (main+0x1283dd4), returns GEngine+0x884
while vsync is on; a fpslocker target_f32 row writes the chosen limit there
each frame. The time update steps by the measured elapsed time.

fps_limit_present offers Game owned and 20 to 60 fps; thermal_cap holds 30
on a hot phone. Game owned is recommended on every phone (the GPU takes
22-25 ms a frame docked), for which a recommend row's fps_cap=own now means
Game owned on the frame limit list too (Recommend.cap, build.gradle,
recommend.py), as dm/games/README.md already documents. The game's other
recommend rows cite README.md.
@tapionallanaire

Copy link
Copy Markdown
Contributor Author

Added experimental frame limits up to 60 fps (f90f93e), with Game owned (the game's own 30) recommended.

  • The game sets present interval 2 once with nvnWindowBuilderSetPresentInterval (main+0xb6ce70); DM_FPSLOCKER_INTERVAL=1 replaces it when a limit is picked.
  • UGameEngine::GetMaxTickRate (main+0x1283dd4) returns the float at GEngine+0x884 while vsync is on (GEngine at main+0x511a150), and the time update sleeps to it. A fpslocker ... target_f32 0x511a150/0x884 row writes the picked rate there.
  • GDeltaTime is the measured frame time (no fixed step unless the USEFIXEDTIMESTEP console command), so the game should not speed up above 30.
  • fps_cap=own was rejected on the frame limit list although dm/games/README.md documents it; Recommend.cap, recommendOf in build.gradle and recommend.py now accept it (one RecommendJvmTest check).
  • With the Turnip road fixes the GPU takes about 22–25 ms a frame docked, so about 40–45 fps is the realistic ceiling on Adreno 740/750; not yet measured on a device.

0ore pushed a commit to 0ore/peanuts-yoda that referenced this pull request Nov 25, 2026
Decals that test depth without writing it sampled the depth attachment the G-buffer
draws before them wrote in the same pass, with no barrier between; on Turnip they read
depth its cache had not written back, losing fixed 32x16-pixel blocks (Batman: Arkham
Knight's road markings, also blinking and grey squares). The pass now notes its depth
writes (R.dwritten) and ends first, so its full barrier makes them visible. Every game;
DM_VK_DEPTH_READ_END=0 turns it off. 60 fps, GPU 5-9 ms on an Adreno 840, against
16-18 ms with upstream PR igawa6#657's TU_DEBUG workaround.

Also: a cube map left in a 3D slot reads as zeros like a 2D texture there.
…nly (sysmem, nolrz and noubwc drew squares on an Adreno 740)
@tapionallanaire

tapionallanaire commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction to the Adreno 740 note (86fdb79): the road markings fix sets TU_DEBUG=flushall again. On an Odin 2 the extra sysmem,nolrz,noubwc were what drew the dark 16-pixel squares at a yellow-grid crossing: they showed on every run with all four modes and on none with flushall alone (one-lane and occlusion fixes on), with or without the game's own 30 fps pacing, the thermal cap and the prewarm seed. The earlier runs that looked clean with more modes were views where the squares happened not to show.

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