Skip to content

Commit 6c8e150

Browse files
authored
cargo: Support ash 0.34 all the way up to ash 0.37 (#104)
Using a ranged semver here allows us to publish non-breaking patch releases whenever bumping to a new - compatible! - `ash` release. The upper bound serves to protect against breaking `ash` changes that may make this crate fail to compile, and is easy to bump whenever we've validated the next version to be compatible. Note that the examples are updated to use the latest `ash 0.37` and `ash-window 0.10.0`, containing breaking improvements around returning raw pointers to required extension string literals instead of `CStr` static borrows.
1 parent 7a5ad82 commit 6c8e150

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ log = "0.4"
2323
thiserror = "1.0"
2424
# Only needed for vulkan. Disable all default features as good practice,
2525
# such as the ability to link/load a Vulkan library.
26-
ash = { version = "0.36", optional = true, default-features = false, features = ["debug"] }
26+
ash = { version = ">=0.34, <=0.37", optional = true, default-features = false, features = ["debug"] }
2727
# Only needed for visualizer.
2828
imgui = { version = "0.8", optional = true }
2929

@@ -33,8 +33,8 @@ winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "
3333

3434
[dev-dependencies]
3535
# Enable the "loaded" feature to be able to access the Vulkan entrypoint.
36-
ash = { version = "0.36", default-features = false, features = ["debug", "loaded"] }
37-
ash-window = "0.9.1"
36+
ash = { version = "0.37", default-features = false, features = ["debug", "loaded"] }
37+
ash-window = "0.10.0"
3838
raw-window-handle = "0.4"
3939
winit = "0.26"
4040
imgui-winit-support = { version = "0.8", default-features = false, features = ["winit-26"] }

examples/vulkan-visualization/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,11 @@ fn main() -> ash::prelude::VkResult<()> {
4848
.collect();
4949

5050
let surface_extensions = ash_window::enumerate_required_extensions(&window).unwrap();
51-
let extensions_names_raw = surface_extensions
52-
.iter()
53-
.map(|ext| ext.as_ptr())
54-
.collect::<Vec<_>>();
5551

5652
let create_info = vk::InstanceCreateInfo::builder()
5753
.application_info(&appinfo)
5854
.enabled_layer_names(&layers_names_raw)
59-
.enabled_extension_names(&extensions_names_raw);
55+
.enabled_extension_names(surface_extensions);
6056

6157
unsafe {
6258
entry

src/vulkan/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ impl Allocation {
6464
/// without this library, because that will lead to undefined behavior.
6565
///
6666
/// # Safety
67-
/// The result of this function can safely be used to pass into [`vk::DeviceFnV1_0::bind_buffer_memory()`],
68-
/// [`vk::DeviceFnV1_0::bind_image_memory()`] etc. It is exposed for this reason. Keep in mind to also
67+
/// The result of this function can safely be used to pass into [`ash::Device::bind_buffer_memory()`],
68+
/// [`ash::Device::bind_image_memory()`] etc. It is exposed for this reason. Keep in mind to also
6969
/// pass [`Self::offset()`] along to those.
7070
pub unsafe fn memory(&self) -> vk::DeviceMemory {
7171
self.device_memory

0 commit comments

Comments
 (0)