Skip to content

Commit 9c05b85

Browse files
fix(hal/vulkan): Use queue family index modified by device open callback (#9965)
1 parent b991e60 commit 9c05b85

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

wgpu-hal/src/vulkan/adapter.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,11 +3011,10 @@ impl super::Adapter {
30113011
let mut enabled_extensions = self.required_device_extensions(features);
30123012
let mut enabled_phd_features = self.physical_device_features(&enabled_extensions, features);
30133013

3014-
let family_index = 0; //TODO
3015-
let family_info = vk::DeviceQueueCreateInfo::default()
3016-
.queue_family_index(family_index)
3017-
.queue_priorities(&[1.0]);
3018-
let mut family_infos = Vec::from([family_info]);
3014+
let default_family_index = 0;
3015+
let mut family_infos = vec![vk::DeviceQueueCreateInfo::default()
3016+
.queue_family_index(default_family_index)
3017+
.queue_priorities(&[1.0])];
30193018

30203019
let mut pre_info = vk::DeviceCreateInfo::default();
30213020

@@ -3069,7 +3068,7 @@ impl super::Adapter {
30693068
features,
30703069
limits,
30713070
memory_hints,
3072-
family_info.queue_family_index,
3071+
family_infos[0].queue_family_index,
30733072
0,
30743073
)
30753074
}

wgpu-hal/src/vulkan/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,10 @@ where
17101710
pub extensions: &'arg mut Vec<&'static CStr>,
17111711
/// The physical device features to enable. You may enable features, but must not disable any.
17121712
pub device_features: &'arg mut PhysicalDeviceFeatures,
1713-
/// The queue create infos for the device. You may add or modify queue create infos as needed.
1713+
/// The queue create infos for the device. You may substitute a different queue, but:
1714+
/// 1. Any queue you provide must be compatible with `wgpu`'s usage,
1715+
/// 2. You must not leave the vector empty,
1716+
/// 3. `wgpu` currently only uses the first entry.
17141717
pub queue_create_infos: &'arg mut Vec<vk::DeviceQueueCreateInfo<'pnext>>,
17151718
/// The create info for the device. You may add or modify things in the pnext chain, but
17161719
/// do not turn features off. Additionally, do not add things to the list of extensions,

0 commit comments

Comments
 (0)