Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade to ash 0.38 #83

Merged
merged 2 commits into from
Apr 3, 2024
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
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
13 changes: 6 additions & 7 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,21 @@
#![allow(unsafe_code)]

use ash::vk;
use std::ffi::CString;
fn main() {
unsafe {
let entry = ash_molten::load();
let app_name = CString::new("Hello Static Molten").unwrap();
let app_name = c"Hello Static Molten";

let appinfo = vk::ApplicationInfo::builder()
.application_name(&app_name)
let appinfo = vk::ApplicationInfo::default()
.application_name(app_name)
.application_version(0)
.engine_name(&app_name)
.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)
}
}
Loading