Skip to content

Commit

Permalink
Persist device queue directly in the Vulkan hal, also added accessor …
Browse files Browse the repository at this point in the history
…to the queue index there.
  • Loading branch information
anlumo committed Aug 14, 2022
1 parent 6706bb8 commit ecca99e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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] {
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<InstanceShared>,
physical_device: ash::vk::PhysicalDevice,
Expand Down

0 comments on commit ecca99e

Please sign in to comment.