From fc0e927f9e42a4023e86824be756d7270a0aa065 Mon Sep 17 00:00:00 2001 From: iChris4 Date: Wed, 23 Sep 2026 01:04:30 +0200 Subject: [PATCH] Write down why the animated array's draws still merge The rule and its cost are not obvious from the code: the substitution is per draw, so the merge test is too, and getting that wrong is worth 6 ms of GPU time a frame in a race. Co-Authored-By: Claude Opus 5 --- OPENXR.md | 7 +++++++ docs/quest-port.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OPENXR.md b/OPENXR.md index ff04489..eada398 100644 --- a/OPENXR.md +++ b/OPENXR.md @@ -407,6 +407,13 @@ the copy (for 30 frames running; the race's opening pan does this) a separate VR which is also what `native_steering_wheel = false` draws. The copy keeps being published, so the vehicle's own wheel returns as soon as draws take it again, and the log notes both switches. +The substitution is decided per draw, and a draw that folds into a neighbour renders through that +neighbour's array binding, so only draws that reached the same decision may merge. Deciding this +per array instead, and so refusing to merge every primitive that binds the vehicle's array, cost 6 ms +of GPU time a frame on a Quest 3 (a race frame has 228 such primitives, recorded once and replayed in +the mono pass and both eyes) and took a 56 FPS race down to 42. `debug.wiicompiled.fpslog 1` reports +the draw calls a frame and the primitives merged away, which is where that shows up first. + The copy is matched against the race camera's view (`RaceCamera::GetViewMtx` with no dolly offset), because the scene camera is only set once the draws run. The log reports, once a second, how far that view is from the scene camera at the seal (`[mkw-vr] cockpit: race camera view vs scene view`) diff --git a/docs/quest-port.md b/docs/quest-port.md index eb4613d..4f9e7ab 100644 --- a/docs/quest-port.md +++ b/docs/quest-port.md @@ -633,7 +633,7 @@ the app: | `debug.wiicompiled.validation 1` | Keeps WebGPU validation and robustness on in release builds | | `debug.wiicompiled.panel_layer 0` | Draws the headset settings panel into the eye images instead of on its own quad layer (`OPENXR.md`, Settings in the headset); read about once a second, so it can be switched while the panel is open | | `debug.wiicompiled.inject :