graphic design tool
git clone https://git.lucas.co/cce-designer.git
fix(vk-smoke): a lost surface fails the smoke test instead of panicking
Use cce-ui's VkRenderer::try_new: a surface lost under the test is the
compositor going away, not a renderer fault, so log it and exit 1. That
was the last caller of the panicking `new` in the workspace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/vk_smoke.rs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/vk_smoke.rs b/src/vk_smoke.rs
index 7bbe0d3..18a6bb4 100644
--- a/src/vk_smoke.rs
+++ b/src/vk_smoke.rs
@@ -339,8 +339,15 @@ fn main() {
let pw = (app.logical_size.0 as f64 * app.scale) as u32;
let ph = (app.logical_size.1 as f64 * app.scale) as u32;
let radius = cce_ui::color::root_plate_corner_radius() * app.scale as f32;
- app.renderer =
- Some(unsafe { VkRenderer::new(display_ptr, surface_ptr, pw, ph, radius) });
+ // A lost surface is the compositor going away under the test, not a
+ // renderer fault: say so and fail, rather than panic.
+ match unsafe { VkRenderer::try_new(display_ptr, surface_ptr, pw, ph, radius) } {
+ Ok(r) => app.renderer = Some(r),
+ Err(lost) => {
+ log::error!("vk-smoke: {lost}");
+ std::process::exit(1);
+ }
+ }
log::info!("vk-smoke: renderer up at {pw}x{ph} (scale {})", app.scale);
// 3D meshes for the viewport scene.