diff --git a/Cargo.lock b/Cargo.lock index c612cb717..b8897d930 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1837,7 +1837,6 @@ dependencies = [ "libc", "libloading", "nom", - "once_cell", "parking_lot", "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 52643db14..0177f592b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ resolver = "2" [workspace.package] edition = "2021" -rust-version = "1.75.0" +rust-version = "1.80.0" license = "MIT OR Apache-2.0" homepage = "https://vulkano.rs" keywords = ["vulkan", "bindings", "graphics", "gpu", "rendering"] @@ -55,7 +55,6 @@ heck = "0.4" indexmap = "2.0" libloading = "0.8" nom = "7.1" -once_cell = "1.17" parking_lot = "0.12" proc-macro2 = "1.0" proc-macro-crate = "3.0" diff --git a/vulkano/Cargo.toml b/vulkano/Cargo.toml index f86c2d4f4..32a313c42 100644 --- a/vulkano/Cargo.toml +++ b/vulkano/Cargo.toml @@ -21,7 +21,6 @@ crossbeam-queue = { workspace = true } foldhash = { workspace = true } half = { workspace = true, features = ["bytemuck"] } libloading = { workspace = true } -once_cell = { workspace = true } parking_lot = { workspace = true, features = ["send_guard"] } raw-window-handle = { workspace = true, features = ["std"] } serde = { workspace = true, optional = true } @@ -42,7 +41,6 @@ foldhash = { workspace = true } heck = { workspace = true } indexmap = { workspace = true } nom = { workspace = true } -once_cell = { workspace = true } proc-macro2 = { workspace = true } quote = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/vulkano/autogen/spirv_parse.rs b/vulkano/autogen/spirv_parse.rs index df99a71d6..5ed00a12f 100644 --- a/vulkano/autogen/spirv_parse.rs +++ b/vulkano/autogen/spirv_parse.rs @@ -1,15 +1,14 @@ use super::{write_file, SpirvGrammar}; use foldhash::{HashMap, HashSet}; use heck::ToSnakeCase; -use once_cell::sync::Lazy; use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote}; -use std::borrow::Cow; +use std::{borrow::Cow, sync::LazyLock}; // From the documentation of the OpSpecConstantOp instruction. // The instructions requiring the Kernel capability are not listed, // as this capability is not supported by Vulkan. -static SPEC_CONSTANT_OP: Lazy> = Lazy::new(|| { +static SPEC_CONSTANT_OP: LazyLock> = LazyLock::new(|| { HashSet::from_iter([ "SConvert", "UConvert", diff --git a/vulkano/src/library.rs b/vulkano/src/library.rs index a3eae0a23..e9d2010d1 100644 --- a/vulkano/src/library.rs +++ b/vulkano/src/library.rs @@ -18,7 +18,7 @@ use ash::vk; use libloading::{Error as LibloadingError, Library}; use std::{ error::Error, - ffi::{CStr, CString}, + ffi::CString, fmt::{Debug, Display, Error as FmtError, Formatter}, mem::transmute, os::raw::c_char, @@ -114,8 +114,12 @@ impl VulkanLibrary { // Vulkan 1.0 implementation. Otherwise, the application can call vkEnumerateInstanceVersion // to determine the version of Vulkan. - let name = unsafe { CStr::from_bytes_with_nul_unchecked(b"vkEnumerateInstanceVersion\0") }; - let func = unsafe { loader.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()) }; + let func = unsafe { + loader.get_instance_proc_addr( + vk::Instance::null(), + c"vkEnumerateInstanceVersion".as_ptr(), + ) + }; let version = if let Some(func) = func { let func: vk::PFN_vkEnumerateInstanceVersion = unsafe { transmute(func) }; diff --git a/vulkano/src/sync/pipeline.rs b/vulkano/src/sync/pipeline.rs index 3d02b6b96..13735fe65 100644 --- a/vulkano/src/sync/pipeline.rs +++ b/vulkano/src/sync/pipeline.rs @@ -11,9 +11,11 @@ use crate::{ }; use ash::vk; use foldhash::HashMap; -use once_cell::sync::Lazy; use smallvec::SmallVec; -use std::{ops::Range, sync::Arc}; +use std::{ + ops::Range, + sync::{Arc, LazyLock}, +}; vulkan_bitflags_enum! { #[non_exhaustive] @@ -1402,9 +1404,9 @@ impl PipelineStageAccess { stages_read: ShaderStages, stages_write: ShaderStages, ) -> impl Iterator + 'static { - static MAP_READ: Lazy< + static MAP_READ: LazyLock< HashMap>, - > = Lazy::new(|| { + > = LazyLock::new(|| { let uniform_read = [ DescriptorType::UniformBuffer, DescriptorType::UniformBufferDynamic, @@ -1582,9 +1584,9 @@ impl PipelineStageAccess { .chain(input_attachment_read) .collect() }); - static MAP_WRITE: Lazy< + static MAP_WRITE: LazyLock< HashMap>, - > = Lazy::new(|| { + > = LazyLock::new(|| { let shader_storage_write = [ DescriptorType::StorageImage, DescriptorType::StorageTexelBuffer,