seedds and v0lumehi
40e6baede5
Preserve unaligned NVN vertex streams on Metal ( #319 )
...
Copy byte-aligned NVN streams into aligned submission-owned storage.
Use CPU snapshots only when host visibility is proven safe; otherwise
encode ordered GPU copies before regular, feedback and geometry draws.
Invalidate copies after overlapping writes and pool remaps while keeping
them reusable across unrelated uniform updates. Restore the encoder after
deferred replay when a stream copy split the pass.
Extend t_vbuf to cover all nonzero address residues, copy reuse, queued
copies, deferred updates, fills, shader writes, previous submissions and
pool replacement. Record the general mechanism and Arkham Knight finding.
The per-stream copy limit remains 64 MiB.
Validated on Apple M4 Pro: 84 GPU checks in each of normal, cache-disabled
and encoder-thread modes with Metal validation; full graphics and host
suites; 70 graphics Python tests; 298 tool tests; documentation tests;
iOS compile check (178 files). Full cross-game validation is incomplete:
the harness reported unsupported OpenGL chain checking and its first NVN
shader rebuild did not finish alongside other active builds. No local
Arkham Knight gameplay run.
Co-authored-by: v0lumehi <aljic.zijad@gmail.com >
2026-10-27 09:46:11 +08:00
..
2026-10-27 07:58:05 +08:00
2026-10-27 07:58:05 +08:00
2026-10-27 03:01:45 +08:00
2026-10-26 15:40:36 +08:00
2026-10-26 07:28:09 +08:00
2026-10-26 09:14:43 +08:00
2026-10-26 07:06:32 +08:00
2026-10-26 08:19:08 +08:00
2026-10-26 02:06:27 +08:00
2026-10-26 07:13:22 +08:00
2026-10-26 14:22:03 +08:00
2026-10-26 13:33:02 +08:00
2026-10-26 07:13:22 +08:00
2026-10-27 03:17:50 +08:00
2026-10-26 12:09:07 +08:00
2026-10-27 03:42:10 +08:00
2026-10-27 07:13:46 +08:00
2026-10-27 03:23:42 +08:00
2026-10-26 07:13:22 +08:00
2026-10-27 03:01:45 +08:00
2026-10-26 14:06:20 +08:00
2026-10-26 09:38:05 +08:00
2026-10-26 02:25:06 +08:00
2026-10-26 02:25:06 +08:00
2026-10-26 19:32:49 +08:00
2026-10-26 10:52:50 +08:00
2026-10-25 20:18:40 +04:00
The prepare step: with a window, the game's first submission waits until the prewarm lists (pso_manifest.tsv, then pso_user.tsv) are built, on every core at user-initiated QoS, behind a "Preparing shaders" screen that shows only past 0.5 s and with 0.3 s or more still to go. nvn_mtl.m: the prewarm reads its lists into tasks (warm_parse): a shader, a compute pipeline, or all render pipelines of one shader pair, which share their bases, so no two workers compile the same base; shaders go into one dictionary the workers share, and a vertex shader's pulling entry is loaded with it (as shader_prefetch_rest does), so neither a draw nor its hybrid stand-in loads a library the lists name. warm_prepare runs the tasks on hw.activecpu workers (DM_PSO_PREPARE_THREADS=<n>) from mtl_sub_begin's first call, before anything of that submission is encoded, and gives the front end done of total every 50 ms once 0.5 s have passed, unless the rate so far leaves less than 0.3 s; the shaders and pipelines go into the caches the draws use at once (warm_claim), which keep them for the run. It runs at the first submission and not before the game starts because the vertex entry each pipeline is built with follows the depth mode the game sets (nvnDeviceSetDepthMode). It runs at every start: with the Metal cache and the pipeline archive warm it takes well under a second and shows nothing, and a stamp that skipped it would skip it exactly when the system has dropped the Metal cache (an OS update, storage pressure on iOS). Without a window, or with DM_PSO_PREPARE=0, the prewarm runs in the background on one worker as before; DM_PSO_PREPARE=1 makes a windowless run wait too. The log line: pipeline prepare: N lines (shaders, render and compute pipelines) in s on N workers before the first frame, progress screen shown or not; bases compiled, from the archive, reused. front.h front_progress: front_mac.m draws the screen with AppKit views over the game's view, front_ios.m with UIKit views over the game view and the pad (a dark view, the title, a bar and a count); nvn_mtl.m keeps a weak empty one for the unit tests. NVN only: the Vulkan and GL layers keep no prewarm lists
2026-10-26 01:43:20 +01:00
2026-10-26 01:43:14 +01:00
2026-10-26 01:43:20 +01:00
2026-10-27 07:58:05 +08:00
2026-10-26 01:25:40 +08:00
2026-10-27 03:01:45 +08:00
2026-10-26 01:21:10 +08:00
2026-10-27 07:58:05 +08:00
2026-10-26 23:43:09 +08:00
2026-10-26 08:19:08 +08:00
2026-10-26 10:13:42 +08:00
2026-10-26 07:13:22 +08:00
2026-10-27 07:58:05 +08:00
2026-10-27 07:58:05 +08:00
2026-10-26 01:05:44 +08:00
2026-10-27 09:46:11 +08:00
2026-10-26 21:49:19 +08:00
2026-10-27 07:58:05 +08:00
2026-10-26 23:43:09 +08:00
2026-10-27 02:33:44 +08:00
2026-10-26 01:43:14 +01:00
2026-10-26 07:13:22 +08:00
2026-10-27 07:58:05 +08:00
2026-10-26 07:13:22 +08:00
2026-10-27 07:13:46 +08:00
2026-10-27 07:58:05 +08:00
2026-10-27 07:58:05 +08:00
2026-10-26 15:40:36 +08:00