Skip to content

Commit

Permalink
Expose the vk::Queue and the queue index in the Vulkan hal.
Browse files Browse the repository at this point in the history
  • Loading branch information
anlumo authored and jimblandy committed Sep 2, 2022
1 parent 701564d commit 9311d3e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9311d3e

Please sign in to comment.