Skip to content

single-device framegen, pacing overhaul, gen8 mipmaps replaeement - #3

Merged
utkarshdalal merged 3 commits into
releasefrom
android-gen8-fixes
Aug 15, 2026
Merged

single-device framegen, pacing overhaul, gen8 mipmaps replaeement#3
utkarshdalal merged 3 commits into
releasefrom
android-gen8-fixes

Conversation

@utkarshdalal

Copy link
Copy Markdown

Reworks the Android path on top of 87f1b93:

  • Single-device framegen: the graph adopts the game's VkInstance/VkDevice (initializeExternal/createContextFromImages) instead of a private device sharing AHBs across ICDs, which scrambled memory when the game ran on a different driver than the system one. Barriers route through a sync1 compat path; required features are merged into the game's device create.
  • Real fence sync on the input copy (Mini::Fence) replacing a no-op submit; repeated timeouts fall back to passthrough presents.
  • Base fps limiter (fps_limit conf key) phase-locked to the display vsync grid published by the app (vsync.txt); generated presents spaced at baseInterval/multiplier with late-slot skip; pause/resume no longer poisons the pacing EWMA (deltas over 250 ms reset it).
  • Clean-room mipmaps replacement shader (shaders/mipmaps_replacement.comp, embedded at build time), default on. Mesa's experimental Adreno gen8 backend miscompiles the DLL's translated mipmaps pass (storage writes stop landing after startup, freezing the flow chain); the replacement computes the same luma pyramid without the fragile single-dispatch TGSM design. orig_mipmaps=true restores the DLL translation; a raw .spv next to conf.toml overrides either.
  • Diagnostics: stats.txt (measured fps + per-stage timing), debug_dump (frame/flow-chain pixel dumps), debug_inputs passthrough modes, adopted- device capability log.
  • Config: hot-apply for fps_limit and debug keys without swapchain recreation; experimental_present_mode conf key (fifo/mailbox/immediate).

Utkarsh Dalal added 3 commits August 15, 2026 10:18
…ement

Reworks the Android path on top of 87f1b93:

- Single-device framegen: the graph adopts the game's VkInstance/VkDevice
  (initializeExternal/createContextFromImages) instead of a private device
  sharing AHBs across ICDs, which scrambled memory when the game ran on a
  different driver than the system one. Barriers route through a sync1
  compat path; required features are merged into the game's device create.
- Real fence sync on the input copy (Mini::Fence) replacing a no-op
  submit; repeated timeouts fall back to passthrough presents.
- Base fps limiter (fps_limit conf key) phase-locked to the display vsync
  grid published by the app (vsync.txt); generated presents spaced at
  baseInterval/multiplier with late-slot skip; pause/resume no longer
  poisons the pacing EWMA (deltas over 250 ms reset it).
- Clean-room mipmaps replacement shader (shaders/mipmaps_replacement.comp,
  embedded at build time), default on. Mesa's experimental Adreno gen8
  backend miscompiles the DLL's translated mipmaps pass (storage writes
  stop landing after startup, freezing the flow chain); the replacement
  computes the same luma pyramid without the fragile single-dispatch TGSM
  design. orig_mipmaps=true restores the DLL translation; a raw .spv next
  to conf.toml overrides either.
- Diagnostics: stats.txt (measured fps + per-stage timing), debug_dump
  (frame/flow-chain pixel dumps), debug_inputs passthrough modes, adopted-
  device capability log.
- Config: hot-apply for fps_limit and debug keys without swapchain
  recreation; experimental_present_mode conf key (fifo/mailbox/immediate).
On a saturated GPU (measured on a device running the game at 18 fps against
a 30 cap) two unbounded waits could freeze the game's present thread
permanently: the generated-frame vkAcquireNextImageKHR (infinite timeout)
and the frame-slot completion fence wait (UINT64_MAX).

- Acquire is bounded at 200 ms; a timed-out generated frame is dropped
  (counted as a skip).
- The completion fence wait is bounded at 2 s and throws before any
  per-frame state changes, so the present falls through cleanly.
- Graph-side fence timeouts feed the same watchdog as the copy fence:
  repeated timeouts disable framegen for the swapchain (full-speed
  passthrough) instead of stalling every frame.
@utkarshdalal
utkarshdalal merged commit f38970c into release Aug 15, 2026
8 checks passed
@utkarshdalal
utkarshdalal deleted the android-gen8-fixes branch August 15, 2026 06:33
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