This repository has been archived on 2026-09-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
xenia-rs/crates/xenia-ui
MechaCat02 79d0026a31 [iterate-4B] --ui perf: bulk frontbuffer detile + present knob + shader/blob caches
Windowed (--ui) mode forces inline GPU, so VdSwap's per-swap UI publish runs
on the emulation thread — profiled at ~87% of it (~4 MIPS effective vs ~35
headless). This lands the low-risk, headless-untouched wins (golden n200m
byte-identical):

- A.1 (biggest): VdSwap frontbuffer detile now uses one bounded GuestMemory
  ::read_bulk instead of ~3.7MB of per-byte read_u8 through the MMIO handler
  (~15 ms/swap). Bounds-checked to stay in the committed backing window.
- A.4: XENIA_PRESENT_MODE (immediate|mailbox|fifo) + XENIA_FRAME_LATENCY knobs
  (render.rs); default (Mailbox-else-Fifo, latency 2) unchanged.
- A.3a: cache parse_shader/pack_for_wgsl per blob key on RenderState instead
  of re-parsing every draw every frame (blobs are immutable) — the
  movie-relevant UI-thread win.
- A.2: publish shader-blob map to the UI only when it changed
  (shader_blobs_version on GpuSystem; publish_xenos_assets blobs arg is now
  Option, None = keep previous). Constants still published every swap.

Deferred (profiling-justified — target the measured bottlenecks, not these):
- A.2 texture-gate, A.3b bind-group cache: zero benefit for the movie (its
  texture keys rotate every frame → always-miss) + staleness/leak risk.
- A.3c submit-batching: the UI thread's bottleneck is the vsync-blocked
  present, not per-draw submits; GPUBUG-111 regression risk not justified.
- A.5 (threaded GPU under --ui): the structural win; separate follow-up
  (needs the publish bridge moved to the worker + human visual verification).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 21:21:51 +02:00
..