diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index b19fb347eec..f78352d9524 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1309,6 +1309,7 @@ impl super::Adapter { raw: raw_device, family_index, queue_index, + raw_queue, handle_is_owned, instance: Arc::clone(&self.instance), physical_device: self.raw, diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index ecb526136fd..db30220c321 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -711,6 +711,10 @@ impl super::Device { self.shared.family_index } + pub fn queue_index(&self) -> u32 { + self.shared.queue_index + } + pub fn raw_device(&self) -> &ash::Device { &self.shared.raw } @@ -720,11 +724,7 @@ impl super::Device { } pub fn raw_queue(&self) -> ash::vk::Queue { - unsafe { - self.shared - .raw - .get_device_queue(self.queue_family_index(), self.shared.queue_index) - } + self.shared.raw_queue } pub fn enabled_device_extensions(&self) -> &[&'static CStr] { diff --git a/wgpu-hal/src/vulkan/mod.rs b/wgpu-hal/src/vulkan/mod.rs index 24d4d8cb7eb..cc9e08be185 100644 --- a/wgpu-hal/src/vulkan/mod.rs +++ b/wgpu-hal/src/vulkan/mod.rs @@ -314,6 +314,7 @@ struct DeviceShared { raw: ash::Device, family_index: u32, queue_index: u32, + raw_queue: ash::vk::Queue, handle_is_owned: bool, instance: Arc, physical_device: ash::vk::PhysicalDevice,