mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-01 14:07:34 -06:00
window_gpu::base_options() built the window's wgpu options from egui_wgpu::WgpuConfiguration::default(), which is egui-wgpu's HIGH_THROUGHPUT surface (desired_maximum_frame_latency 2; three drawables on Metal), not eframe's default. eframe's NativeOptions::default() uses LOW_LATENCY (latency 1). The window had eframe's default until #136 started building the options by hand to choose the backends. Start from eframe::NativeOptions::default().wgpu_options and change only the backends, the DX12 compiler and the instance flags, as before. The probed Windows configurations are built on the same options. Measured on an M2 Max at 120 Hz (Metal System Trace, heavy develop drag, presents joined to WindowServer's reads of the same IOSurface): the window cycles 2 drawables instead of 3, and a frame reaches the compositor about 8.3 ms (one frame) sooner, 9.5-10.6 ms instead of 17.9-18.9 ms after it is presented, at the same ~119 frames a second. Test: window_gpu::tests::window_surface_keeps_one_frame_in_flight (fails on the old options: latency Some(2) instead of Some(1)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>