Expose the vk::Queue and the queue index in the Vulkan hal. (#2950)

This commit is contained in:
Andreas Monitzer
2022-09-03 00:58:01 +02:00
committed by GitHub
parent 701564da8c
commit 6348a07d28
4 changed files with 13 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ the same every time it is rendered, we now warn if it is missing.
#### Vulkan
- Remove use of Vulkan12Features/Properties types. By @i509VCB in [#2936](https://github.com/gfx-rs/wgpu/pull/2936)
- Provide a means for `wgpu` users to access `vk::Queue` and the queue index. By @anlumo in [#2950](https://github.com/gfx-rs/wgpu/pull/2950)
### Documentation

View File

@@ -1181,6 +1181,8 @@ impl super::Adapter {
let shared = Arc::new(super::DeviceShared {
raw: raw_device,
family_index,
queue_index,
raw_queue,
handle_is_owned,
instance: Arc::clone(&self.instance),
physical_device: self.raw,

View File

@@ -714,6 +714,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
}
@@ -722,6 +726,10 @@ impl super::Device {
self.shared.physical_device
}
pub fn raw_queue(&self) -> ash::vk::Queue {
self.shared.raw_queue
}
pub fn enabled_device_extensions(&self) -> &[&'static CStr] {
&self.shared.enabled_extensions
}

View File

@@ -296,6 +296,8 @@ impl UpdateAfterBindTypes {
struct DeviceShared {
raw: ash::Device,
family_index: u32,
queue_index: u32,
raw_queue: ash::vk::Queue,
handle_is_owned: bool,
instance: Arc<InstanceShared>,
physical_device: ash::vk::PhysicalDevice,