Skip to content

Commit

Permalink
Fix vulkano-util depending on vulkano-win (vulkano-rs#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 authored and hakolao committed Feb 20, 2024
1 parent 38c3907 commit 24bb331
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion vulkano-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ readme = "../README.md"
[dependencies]
ahash = "0.8"
vulkano = { version = "0.34.0", path = "../vulkano", default-features = false }
vulkano-win = { version = "0.34.0", path = "../vulkano-win" }
winit = { version = "0.28" }
18 changes: 15 additions & 3 deletions vulkano-util/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ impl VulkanoContext {
/// # Panics
///
/// - Panics where the underlying Vulkano struct creations fail
// FIXME:
#[allow(deprecated)]
pub fn new(mut config: VulkanoConfig) -> Self {
let library = match VulkanLibrary::new() {
Ok(x) => x,
Expand All @@ -139,7 +137,21 @@ impl VulkanoContext {
};

// Append required extensions
config.instance_create_info.enabled_extensions = vulkano_win::required_extensions(&library)
// HACK: This should be replaced with `Surface::required_extensions`, but will need to
// happen in the next minor version bump. It should have been done before releasing 0.34.
config.instance_create_info.enabled_extensions = library
.supported_extensions()
.intersection(&InstanceExtensions {
khr_surface: true,
khr_xlib_surface: true,
khr_xcb_surface: true,
khr_wayland_surface: true,
khr_android_surface: true,
khr_win32_surface: true,
mvk_ios_surface: true,
mvk_macos_surface: true,
..InstanceExtensions::empty()
})
.union(&config.instance_create_info.enabled_extensions);

// Create instance
Expand Down

0 comments on commit 24bb331

Please # to comment.