From a990c8975834fcae8f34d300b0eb6889ccb80396 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 12 Mar 2026 14:13:42 -0700 Subject: [PATCH] backend/wayland/vulkan: Fix use of Vulkan (correctly this time) It seems https://github.com/pop-os/cosmic-workspaces-epoch/pull/280 was just wrong. I didn't test it correctly, and it actually prevented crashes simply because the Vulkan instance failed to create. This failed because it's a device extension, not an instance extension (and we already check for the device extension). The *real* issue seems to be simply the fact this was using the `Instance` after dropping the `Entry`. Which is easy enough to address. --- src/backend/wayland/vulkan.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/wayland/vulkan.rs b/src/backend/wayland/vulkan.rs index 25dcedf..244a096 100644 --- a/src/backend/wayland/vulkan.rs +++ b/src/backend/wayland/vulkan.rs @@ -3,6 +3,7 @@ use std::{collections::HashMap, ffi::CStr}; pub struct Vulkan { instance: ash::Instance, + _entry: ash::Entry, // TODO purge cache at some point device_name_cache: HashMap>>, } @@ -14,14 +15,13 @@ impl Vulkan { api_version: vk::make_api_version(0, 1, 1, 0), ..Default::default() }; - let extensions = &[c"VK_EXT_physical_device_drm".as_ptr()]; let create_info = vk::InstanceCreateInfo { p_application_info: &app_info, ..Default::default() - } - .enabled_extension_names(extensions); + }; let instance = unsafe { entry.create_instance(&create_info, None).ok()? }; Some(Self { + _entry: entry, instance, device_name_cache: HashMap::new(), })