diff --git a/apps/cadcraft/src/renderer.rs b/apps/cadcraft/src/renderer.rs index 6165bf54e..fa13ed217 100644 --- a/apps/cadcraft/src/renderer.rs +++ b/apps/cadcraft/src/renderer.rs @@ -567,9 +567,10 @@ mod tests { } } - /// The read-back check passes on a working device, with and without a stencil buffer. The - /// device is made as the app makes it: on Windows DirectX 12 alone with FXC (graphics.rs; an - /// AMD driver crashes when OpenGL is created there, #31), and egui's limits for the adapter. + /// The read-back is answered and passes on a working device, with and without a stencil + /// buffer. The device is made as the app makes it: on Windows DirectX 12 alone with FXC + /// (graphics.rs; an AMD driver crashes when OpenGL is created there, #31), and egui's limits for + /// the adapter. #[test] fn the_check_passes_on_a_device_that_draws() { let mut options = eframe::NativeOptions::default(); @@ -583,8 +584,15 @@ mod tests { eprintln!("no graphics adapter here: the device check is left to machines with one"); return; }; - check(&rs.device, &rs.queue, None).unwrap(); - check(&rs.device, &rs.queue, Some(wgpu::TextureFormat::Stencil8)).unwrap(); + let info = rs.adapter.get_info(); + for stencil in [None, Some(wgpu::TextureFormat::Stencil8)] { + // `check` takes no answer as a pass; a working device must answer, or every start on it + // would wait for the timeout. + let started = std::time::Instant::now(); + let read = clear_and_read(&rs.device, &rs.queue, stencil); + let elapsed = started.elapsed(); + assert_eq!(read, Ok(true), "{stencil:?} on {} ({:?}, {:?}) after {elapsed:?}", info.name, info.backend, info.device_type); + } } /// The read-back passes only when every pixel came back cleared: a target the clear never