Skip to content

Commit

Permalink
Upgrade to ash 0.38
Browse files Browse the repository at this point in the history
Unfortunately the modules moved around (for a purer `ash::vk`) which
make this crate release incompatible with former breaking releases.
  • Loading branch information
MarijnS95 committed Apr 3, 2024
1 parent 1079a48 commit cdc9884
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build = "build/build.rs"
#
# NB: you must check that `ash-molten` compiles with every `ash` version
# in this range, not just the start and the end, to be sure it's compatible.
version = ">=0.35, <=0.37"
version = "0.38"
default-features = false

[build-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ fn main() {
let entry = ash_molten::load();
let app_name = CString::new("Hello Static Molten").unwrap();

let appinfo = vk::ApplicationInfo::builder()
let appinfo = vk::ApplicationInfo::default()
.application_name(&app_name)
.application_version(0)
.engine_name(&app_name)
.engine_version(0)
.api_version(vk::make_api_version(0, 1, 0, 0));

let create_info = vk::InstanceCreateInfo::builder().application_info(&appinfo);
let create_info = vk::InstanceCreateInfo::default().application_info(&appinfo);
let instance = entry.create_instance(&create_info, None).expect("Instance");
let devices = instance.enumerate_physical_devices();
println!("{:?}", devices);
println!("Physical devices: {:?}", devices);
}
}
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ash::{vk, Entry};
use ash::vk;

extern "system" {
fn vkGetInstanceProcAddr(
Expand All @@ -8,12 +8,12 @@ extern "system" {
}

/// Fetches the function pointer to `vkGetInstanceProcAddr` which is statically linked.
pub fn load() -> Entry {
let static_fn = vk::StaticFn {
pub fn load() -> ash::Entry {
let static_fn = ash::StaticFn {
get_instance_proc_addr: vkGetInstanceProcAddr,
};
#[allow(unsafe_code)]
unsafe {
Entry::from_static_fn(static_fn)
ash::Entry::from_static_fn(static_fn)
}
}

0 comments on commit cdc9884

Please sign in to comment.