From 688cf76271ced721d9af83ef4fcbe4ecd0861ff7 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 11:49:01 -0800 Subject: [PATCH] Example queue_share: frames makes the compositor's queue before the application starts Other queues' batches are held back only while an unshared queue exists, so with the compositor's queue made 50 ms after the application began, the application's first command buffers went untracked and the compositor's first frames waited behind all three: one 85-87 ms wait in every run on both the Iris Xe and the Radeon 780M (m3-max-16884, -16885), which set the worst wait the run reported. A compositor's queue exists before the applications it shows. --- crates/metal2vulkan-runtime/examples/queue_share.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-runtime/examples/queue_share.rs b/crates/metal2vulkan-runtime/examples/queue_share.rs index 5d73ca343..1491f00ce 100644 --- a/crates/metal2vulkan-runtime/examples/queue_share.rs +++ b/crates/metal2vulkan-runtime/examples/queue_share.rs @@ -526,7 +526,9 @@ fn beside(kit: &Arc, options: &Options, short: Duration, long_every: usize, /// A compositor committing one draw every `options.period` beside an application keeping /// `options.in_flight` long command buffers in flight: the compositor's latencies, the /// application's long command buffers a second, and the device's counts of waits behind other -/// queues' batches over the run. +/// queues' batches over the run. The compositor's queue is made before the application starts, as +/// a compositor's exists before the applications it shows: other queues' batches are held back +/// only while an unshared queue exists. fn frames(kit: &Arc, options: &Options) { let stop = Arc::new(AtomicBool::new(false)); let latencies = Arc::new(Mutex::new(Vec::new())); @@ -534,12 +536,13 @@ fn frames(kit: &Arc, options: &Options) { let before = kit.device.work_counts(); let began = Instant::now(); let shape = (Duration::ZERO, 1, options.in_flight); + let queue = kit.queue(options.unshared); let app = application(kit, shape, &stop, Some(Arc::clone(×))); std::thread::sleep(Duration::from_millis(50)); let rate = 1.0 / options.period.as_secs_f64(); let comp = compositor( kit, - kit.queue(options.unshared), + queue, rate, &stop, &latencies,