Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for VK_KHR_portability_subset Devices #1927

Merged
merged 4 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions examples/src/bin/basic-compute-shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ use vulkano::{
physical::{PhysicalDevice, PhysicalDeviceType},
Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
},
instance::Instance,
instance::{Instance, InstanceCreateInfo},
pipeline::{ComputePipeline, Pipeline, PipelineBindPoint},
sync::{self, GpuFuture},
};

fn main() {
// As with other examples, the first step is to create an instance.
let instance = Instance::new(Default::default()).unwrap();
let instance = Instance::new(InstanceCreateInfo {
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();

// Choose which physical device to use.
let device_extensions = DeviceExtensions {
Expand Down Expand Up @@ -63,9 +68,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/buffer-pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -106,9 +108,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/clear_attachments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -77,9 +79,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ fn main() {
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: extensions,
enabled_layers: layers,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.expect("failed to create Vulkan instance");
Expand Down Expand Up @@ -152,9 +154,7 @@ fn main() {
let (_, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/deferred/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -96,9 +98,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
13 changes: 8 additions & 5 deletions examples/src/bin/dynamic-buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ use vulkano::{
physical::{PhysicalDevice, PhysicalDeviceType},
Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
},
instance::Instance,
instance::{Instance, InstanceCreateInfo},
pipeline::{ComputePipeline, Pipeline, PipelineBindPoint},
sync::{self, GpuFuture},
};

fn main() {
let instance = Instance::new(Default::default()).unwrap();
let instance = Instance::new(InstanceCreateInfo {
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();

let device_extensions = DeviceExtensions {
khr_storage_buffer_storage_class: true,
Expand Down Expand Up @@ -62,9 +67,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/dynamic-local-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ fn main() {

..InstanceExtensions::none()
},
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -71,9 +73,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
4 changes: 4 additions & 0 deletions examples/src/bin/gl-interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ mod linux {
..InstanceExtensions::none()
}
.union(&required_extensions),

// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,

..Default::default()
})
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/image-self-copy-blit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -96,9 +98,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/image/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -94,9 +96,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
13 changes: 8 additions & 5 deletions examples/src/bin/immutable-buffer-initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use vulkano::{
physical::{PhysicalDevice, PhysicalDeviceType},
Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
},
instance::Instance,
instance::{Instance, InstanceCreateInfo},
pipeline::{ComputePipeline, Pipeline, PipelineBindPoint},
sync::{self, GpuFuture},
};
Expand All @@ -26,7 +26,12 @@ fn main() {
// The most part of this example is exactly the same as `basic-compute-shader`. You should read the
// `basic-compute-shader` example if you haven't done so yet.

let instance = Instance::new(Default::default()).unwrap();
let instance = Instance::new(InstanceCreateInfo {
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();

let device_extensions = DeviceExtensions {
khr_storage_buffer_storage_class: true,
Expand Down Expand Up @@ -57,9 +62,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/immutable-sampler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -100,9 +102,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -114,9 +116,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/instancing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -112,9 +114,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/msaa-renderpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -130,9 +132,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/multi-window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -114,9 +116,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/multiview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ fn main() {
khr_get_physical_device_properties2: true, // required to get multiview limits
..InstanceExtensions::none()
},
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -107,9 +109,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
enabled_features: features,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/occlusion-query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ fn main() {
let required_extensions = vulkano_win::required_extensions();
let instance = Instance::new(InstanceCreateInfo {
enabled_extensions: required_extensions,
// Enable enumerating devices that use non-conformant vulkan implementations. (ex. MoltenVK)
enumerate_portability: true,
..Default::default()
})
.unwrap();
Expand Down Expand Up @@ -91,9 +93,7 @@ fn main() {
let (device, mut queues) = Device::new(
physical_device,
DeviceCreateInfo {
enabled_extensions: physical_device
.required_extensions()
.union(&device_extensions),
enabled_extensions: device_extensions,
queue_create_infos: vec![QueueCreateInfo::family(queue_family)],
..Default::default()
},
Expand Down
Loading