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

Ash038 #77

Merged
merged 4 commits into from
Apr 9, 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
4 changes: 2 additions & 2 deletions ash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gpu-alloc-ash"
version = "0.6.0"
version = "0.7.0"
authors = ["Zakarum <[email protected]>"]
edition = "2018"
description = "`ash` backend for `gpu-alloc`"
Expand All @@ -15,5 +15,5 @@ categories = ["graphics", "memory-management", "no-std", "game-development"]
[dependencies]
gpu-alloc-types = { path = "../types", version = "=0.3.0" }
tracing = { version = "0.1", features = ["attributes"], optional = true }
ash = { version = "0.37", default-features = false }
ash = { version = "0.38", default-features = false }
tinyvec = { version = "1.0", default-features = false, features = ["alloc"] }
12 changes: 5 additions & 7 deletions ash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ impl MemoryDevice<vk::DeviceMemory> for AshMemoryDevice {
) -> Result<vk::DeviceMemory, OutOfMemory> {
assert!((flags & !(AllocationFlags::DEVICE_ADDRESS)).is_empty());

let mut info = vk::MemoryAllocateInfo::builder()
let mut info = vk::MemoryAllocateInfo::default()
.allocation_size(size)
.memory_type_index(memory_type);

let mut info_flags;

if flags.contains(AllocationFlags::DEVICE_ADDRESS) {
info_flags = vk::MemoryAllocateFlagsInfo::builder()
info_flags = vk::MemoryAllocateFlagsInfo::default()
.flags(vk::MemoryAllocateFlags::DEVICE_ADDRESS);
info = info.push_next(&mut info_flags);
}
Expand Down Expand Up @@ -217,11 +217,10 @@ impl MemoryDevice<vk::DeviceMemory> for AshMemoryDevice {
&ranges
.iter()
.map(|range| {
vk::MappedMemoryRange::builder()
vk::MappedMemoryRange::default()
.memory(*range.memory)
.offset(range.offset)
.size(range.size)
.build()
})
.collect::<TinyVec<[_; 4]>>(),
)
Expand All @@ -242,11 +241,10 @@ impl MemoryDevice<vk::DeviceMemory> for AshMemoryDevice {
&ranges
.iter()
.map(|range| {
vk::MappedMemoryRange::builder()
vk::MappedMemoryRange::default()
.memory(*range.memory)
.offset(range.offset)
.size(range.size)
.build()
})
.collect::<TinyVec<[_; 4]>>(),
)
Expand Down Expand Up @@ -282,7 +280,7 @@ pub unsafe fn device_properties(

let buffer_device_address =
if vk::api_version_major(version) >= 1 && vk::api_version_minor(version) >= 2 {
let mut features = PhysicalDeviceFeatures2::builder();
let mut features = PhysicalDeviceFeatures2::default();
let mut bda_features = vk::PhysicalDeviceBufferDeviceAddressFeatures::default();
features.p_next =
&mut bda_features as *mut vk::PhysicalDeviceBufferDeviceAddressFeatures as *mut _;
Expand Down
10 changes: 7 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ publish = false
mock = ["gpu-alloc-mock"]

[dependencies]
gpu-alloc = { path = "../gpu-alloc", version = "=0.6.0", features = ["tracing"] }
gpu-alloc = { path = "../gpu-alloc", version = "=0.6.0", features = [
"tracing",
] }
eyre = "0.6"
color-eyre = "0.6"
gpu-alloc-mock = { path = "../mock", version = "=0.3", optional = true }
gpu-alloc-erupt = { path = "../erupt", version = "=0.9", optional = true }
erupt = { version = "0.23.0", optional = true, features = ["loading"] }
gpu-alloc-ash = { path = "../ash", version = "=0.6", optional = true }
ash = { version = "0.37", default-features = false, features = ["loaded"], optional = true }
gpu-alloc-ash = { path = "../ash", version = "=0.7", optional = true }
ash = { version = "0.38", default-features = false, features = [
"loaded",
], optional = true }

tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
tracing-error = { version = "0.2" }
Expand Down
Loading