Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
davnotdev committed Apr 28, 2024
1 parent d4586c2 commit 399794e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ pollster = "0.3"
raw-window-handle = { version = "0.6.0", optional = true }

# naga_translation
naga = { version = "0.12", features = ["glsl-in", "spv-in", "wgsl-in", "spv-out", "wgsl-out"], optional = true }
naga = { version = "0.19", features = ["glsl-in", "spv-in", "wgsl-in", "spv-out", "wgsl-out"], optional = true }

[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
# vulkan
ash = { version = "0.37.3", optional = true }
gpu-allocator = { version = "0.21.0", optional = true }
gpu-allocator = { version = "0.25.0", optional = true }

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
# vulkan
Expand Down
5 changes: 3 additions & 2 deletions src/vulkan/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl VkContext {

let each_size = std::mem::size_of::<T>();
let byte_slice = unsafe {
std::slice::from_raw_parts(data.as_ptr() as *const u8, each_size * data.len())
std::slice::from_raw_parts(data.as_ptr() as *const u8, std::mem::size_of_val(data))
};
let padded_buf =
unsafe { pad_raw_slice(byte_slice, min_ubo_alignment, each_size, data.len()) };
Expand Down Expand Up @@ -231,7 +231,7 @@ impl VkContext {
storage_type: BufferStorageType,
additional_buffer_usage: vk::BufferUsageFlags,
) -> GResult<(VkBuffer, Option<VkBuffer>)> {
let buf_size = std::mem::size_of::<T>() * data.len();
let buf_size = std::mem::size_of_val(data);

let mut staging = VkBuffer::new(
&self.core.dev,
Expand Down Expand Up @@ -300,6 +300,7 @@ impl VkBuffer {
requirements,
location: mem_usage,
linear: true,
allocation_scheme: AllocationScheme::GpuAllocatorManaged
})
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions src/vulkan/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl VkImage {
requirements,
location: MemoryLocation::GpuOnly,
linear: true,
allocation_scheme: AllocationScheme::GpuAllocatorManaged
})
.unwrap();

Expand Down
3 changes: 2 additions & 1 deletion src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::context::{self, *};
use super::error::{gpu_api_err, GResult, GpuError};
use ash::{extensions as vk_extensions, vk, Entry, *};
use gpu_allocator::{
vulkan::{Allocation, AllocationCreateDesc, Allocator, AllocatorCreateDesc},
vulkan::{Allocation, AllocationCreateDesc, AllocationScheme, Allocator, AllocatorCreateDesc},
MemoryLocation,
};
use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
Expand Down Expand Up @@ -148,6 +148,7 @@ impl VkContext {
debug_settings: Default::default(),
// TODO OPT: We should enable this perhaps?
buffer_device_address: false,
allocation_sizes: Default::default(),
})
.map_err(|e| gpu_api_err!("vulkan gpu_allocator {}", e))?;

Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl VkTexture {
let mut offset = 0;
for data in datas.iter() {
self.staging
.map_copy_data(data.as_ptr() as *const u8, data.len(), offset)?;
.map_copy_data(data.as_ptr(), data.len(), offset)?;
offset += data.len();
}

Expand Down
1 change: 0 additions & 1 deletion src/vulkan/vkcore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ impl VkCore {
// ## Actually Make It
let dev_create = vk::DeviceCreateInfo::builder()
.enabled_extension_names(&dev_extensions)
.enabled_layer_names(&layers)
.enabled_features(&features)
.queue_create_infos(&queues_create)
.build();
Expand Down

0 comments on commit 399794e

Please sign in to comment.