diff --git a/Cargo.lock b/Cargo.lock index 1664e7bd7a..f2aa9703c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -476,6 +476,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.5.0" @@ -1798,10 +1804,10 @@ dependencies = [ name = "vulkano" version = "0.34.0" dependencies = [ - "ahash", "ash", "bytemuck", "crossbeam-queue", + "foldhash", "half", "heck", "indexmap", @@ -1839,7 +1845,7 @@ dependencies = [ name = "vulkano-shaders" version = "0.34.0" dependencies = [ - "ahash", + "foldhash", "heck", "proc-macro2", "quote", @@ -1852,9 +1858,9 @@ dependencies = [ name = "vulkano-taskgraph" version = "0.34.0" dependencies = [ - "ahash", "ash", "concurrent-slotmap", + "foldhash", "parking_lot", "smallvec", "thread_local", @@ -1865,7 +1871,7 @@ dependencies = [ name = "vulkano-util" version = "0.34.0" dependencies = [ - "ahash", + "foldhash", "vulkano", "winit", ] diff --git a/Cargo.toml b/Cargo.toml index a1b2011f43..7632afb4cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,6 @@ version = "0.34" path = "vulkano-util" [workspace.dependencies] -ahash = "0.8" # When updating Ash, also update vk.xml to the same Vulkan patch version that Ash uses. # All versions of vk.xml can be found at: # https://github.com/KhronosGroup/Vulkan-Headers/commits/main/registry/vk.xml @@ -51,6 +50,7 @@ ash = "0.38.0" bytemuck = "1.9" concurrent-slotmap = "0.1.0-alpha.1" crossbeam-queue = "0.3" +foldhash = "0.1" half = "2.0" heck = "0.4" indexmap = "2.0" diff --git a/vulkano-shaders/Cargo.toml b/vulkano-shaders/Cargo.toml index e21e1e5a86..f71e63a30b 100644 --- a/vulkano-shaders/Cargo.toml +++ b/vulkano-shaders/Cargo.toml @@ -17,7 +17,7 @@ categories = { workspace = true } proc-macro = true [dependencies] -ahash = { workspace = true } +foldhash = { workspace = true } heck = { workspace = true } proc-macro2 = { workspace = true } quote = { workspace = true } diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index bcb808a4f6..8671d938e5 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -227,7 +227,7 @@ #![recursion_limit = "1024"] use crate::codegen::ShaderKind; -use ahash::HashMap; +use foldhash::HashMap; use proc_macro2::{Span, TokenStream}; use quote::quote; use shaderc::{EnvVersion, SpirvVersion}; diff --git a/vulkano-shaders/src/structs.rs b/vulkano-shaders/src/structs.rs index e79edcb307..387e0ccbcc 100644 --- a/vulkano-shaders/src/structs.rs +++ b/vulkano-shaders/src/structs.rs @@ -1,5 +1,5 @@ use crate::{bail, codegen::Shader, LinAlgType, MacroInput}; -use ahash::HashMap; +use foldhash::HashMap; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens, TokenStreamExt}; use std::{cmp::Ordering, num::NonZeroUsize}; diff --git a/vulkano-taskgraph/Cargo.toml b/vulkano-taskgraph/Cargo.toml index 8af6fb8488..b7011f8d09 100644 --- a/vulkano-taskgraph/Cargo.toml +++ b/vulkano-taskgraph/Cargo.toml @@ -14,9 +14,9 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] -ahash = { workspace = true } ash = { workspace = true } concurrent-slotmap = { workspace = true } +foldhash = { workspace = true } parking_lot = { workspace = true } smallvec = { workspace = true } thread_local = { workspace = true } diff --git a/vulkano-taskgraph/src/graph/compile.rs b/vulkano-taskgraph/src/graph/compile.rs index c943409725..c82b4a727a 100644 --- a/vulkano-taskgraph/src/graph/compile.rs +++ b/vulkano-taskgraph/src/graph/compile.rs @@ -2223,7 +2223,7 @@ mod tests { struct MatchingState { submission_index: usize, instruction_index: usize, - semaphores: ahash::HashMap<&'static str, SemaphoreIndex>, + semaphores: foldhash::HashMap<&'static str, SemaphoreIndex>, } macro_rules! assert_matches_instructions { diff --git a/vulkano-taskgraph/src/graph/mod.rs b/vulkano-taskgraph/src/graph/mod.rs index 7d1e457c48..e7eae1e181 100644 --- a/vulkano-taskgraph/src/graph/mod.rs +++ b/vulkano-taskgraph/src/graph/mod.rs @@ -8,9 +8,9 @@ use crate::{ resource::{self, AccessType, Flight, HostAccessType, ImageLayoutType}, Id, InvalidSlotError, Object, ObjectType, QueueFamilyType, Task, }; -use ahash::HashMap; use ash::vk; use concurrent_slotmap::{IterMut, IterUnprotected, SlotId, SlotMap}; +use foldhash::HashMap; use smallvec::SmallVec; use std::{ borrow::Cow, cell::RefCell, error::Error, fmt, hint, iter::FusedIterator, ops::Range, sync::Arc, diff --git a/vulkano-util/Cargo.toml b/vulkano-util/Cargo.toml index c17a9b1922..a48c461712 100644 --- a/vulkano-util/Cargo.toml +++ b/vulkano-util/Cargo.toml @@ -14,7 +14,7 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] -ahash = { workspace = true } +foldhash = { workspace = true } vulkano = { workspace = true } winit = { workspace = true } diff --git a/vulkano-util/src/renderer.rs b/vulkano-util/src/renderer.rs index ae71363b06..92607dc7ff 100644 --- a/vulkano-util/src/renderer.rs +++ b/vulkano-util/src/renderer.rs @@ -1,5 +1,5 @@ use crate::{context::VulkanoContext, window::WindowDescriptor}; -use ahash::HashMap; +use foldhash::HashMap; use std::{sync::Arc, time::Duration}; use vulkano::{ device::{Device, Queue}, diff --git a/vulkano-util/src/window.rs b/vulkano-util/src/window.rs index 5cb96927e2..1193eea9cf 100644 --- a/vulkano-util/src/window.rs +++ b/vulkano-util/src/window.rs @@ -3,7 +3,7 @@ // https://github.com/bevyengine/bevy/blob/main/LICENSE-APACHE use crate::{context::VulkanoContext, renderer::VulkanoWindowRenderer}; -use ahash::HashMap; +use foldhash::HashMap; use std::collections::hash_map::{Iter, IterMut}; use vulkano::swapchain::{PresentMode, SwapchainCreateInfo}; use winit::{ diff --git a/vulkano/Cargo.toml b/vulkano/Cargo.toml index 328481dd9c..5294f52066 100644 --- a/vulkano/Cargo.toml +++ b/vulkano/Cargo.toml @@ -15,10 +15,10 @@ keywords = { workspace = true } categories = { workspace = true } [dependencies] -ahash = { workspace = true } ash = { workspace = true } bytemuck = { workspace = true, features = ["min_const_generics"] } crossbeam-queue = { workspace = true } +foldhash = { workspace = true } half = { workspace = true, features = ["bytemuck"] } libloading = { workspace = true } once_cell = { workspace = true } @@ -38,7 +38,7 @@ x11-dl = { workspace = true, optional = true } x11rb = { workspace = true, features = ["allow-unsafe-code"], optional = true } [build-dependencies] -ahash = { workspace = true } +foldhash = { workspace = true } heck = { workspace = true } indexmap = { workspace = true } nom = { workspace = true } diff --git a/vulkano/autogen/features.rs b/vulkano/autogen/features.rs index a676b92900..b5ac288723 100644 --- a/vulkano/autogen/features.rs +++ b/vulkano/autogen/features.rs @@ -1,5 +1,5 @@ use super::{write_file, IndexMap, VkRegistryData}; -use ahash::HashMap; +use foldhash::HashMap; use heck::ToSnakeCase; use nom::{bytes::complete::tag, character::complete::digit1, combinator::eof, sequence::tuple}; use proc_macro2::{Ident, TokenStream}; diff --git a/vulkano/autogen/mod.rs b/vulkano/autogen/mod.rs index 0bccf0d738..0ba3264dcf 100644 --- a/vulkano/autogen/mod.rs +++ b/vulkano/autogen/mod.rs @@ -1,5 +1,5 @@ use self::spirv_grammar::SpirvGrammar; -use ahash::HashMap; +use foldhash::HashMap; use nom::{ bytes::complete::{tag, take_until}, character::complete::{self, multispace0, multispace1}, @@ -34,7 +34,7 @@ mod spirv_parse; mod spirv_reqs; mod version; -pub type IndexMap = indexmap::IndexMap; +pub type IndexMap = indexmap::IndexMap; pub fn autogen() { let registry = get_vk_registry("vk.xml"); diff --git a/vulkano/autogen/properties.rs b/vulkano/autogen/properties.rs index 3d71c03f00..e3f141bc92 100644 --- a/vulkano/autogen/properties.rs +++ b/vulkano/autogen/properties.rs @@ -1,5 +1,5 @@ use super::{write_file, IndexMap, VkRegistryData}; -use ahash::{HashMap, HashSet}; +use foldhash::{HashMap, HashSet}; use heck::ToSnakeCase; use nom::{ bytes::complete::{tag, take_until, take_while1}, diff --git a/vulkano/autogen/spirv_parse.rs b/vulkano/autogen/spirv_parse.rs index 6e8afe6c4b..df99a71d65 100644 --- a/vulkano/autogen/spirv_parse.rs +++ b/vulkano/autogen/spirv_parse.rs @@ -1,5 +1,5 @@ use super::{write_file, SpirvGrammar}; -use ahash::{HashMap, HashSet}; +use foldhash::{HashMap, HashSet}; use heck::ToSnakeCase; use once_cell::sync::Lazy; use proc_macro2::{Ident, TokenStream}; diff --git a/vulkano/src/cache.rs b/vulkano/src/cache.rs index 371fbed55a..fc09ed113b 100644 --- a/vulkano/src/cache.rs +++ b/vulkano/src/cache.rs @@ -1,4 +1,4 @@ -use ahash::HashMap; +use foldhash::HashMap; use parking_lot::RwLock; use std::{ collections::hash_map::Entry, diff --git a/vulkano/src/command_buffer/auto/builder.rs b/vulkano/src/command_buffer/auto/builder.rs index ca953227b9..34a048d8b9 100644 --- a/vulkano/src/command_buffer/auto/builder.rs +++ b/vulkano/src/command_buffer/auto/builder.rs @@ -41,7 +41,7 @@ use crate::{ }, DeviceSize, Validated, ValidationError, VulkanError, }; -use ahash::HashMap; +use foldhash::HashMap; use parking_lot::{Mutex, RwLockReadGuard}; use smallvec::SmallVec; use std::{ diff --git a/vulkano/src/command_buffer/mod.rs b/vulkano/src/command_buffer/mod.rs index 88e719c8b8..2043c6073e 100644 --- a/vulkano/src/command_buffer/mod.rs +++ b/vulkano/src/command_buffer/mod.rs @@ -125,8 +125,8 @@ use crate::{ device::{DeviceFeatures, DeviceProperties}, pipeline::graphics::vertex_input::VertexInputRate, }; -use ahash::HashMap; use bytemuck::{Pod, Zeroable}; +use foldhash::HashMap; use smallvec::SmallVec; use std::{ops::Range, sync::Arc}; diff --git a/vulkano/src/descriptor_set/layout.rs b/vulkano/src/descriptor_set/layout.rs index 13a97486d9..e828a82249 100644 --- a/vulkano/src/descriptor_set/layout.rs +++ b/vulkano/src/descriptor_set/layout.rs @@ -11,7 +11,7 @@ use crate::{ Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, Version, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; use std::{collections::BTreeMap, mem::MaybeUninit, num::NonZeroU64, ptr, sync::Arc}; @@ -1396,7 +1396,7 @@ mod tests { }, shader::ShaderStages, }; - use ahash::HashMap; + use foldhash::HashMap; #[test] fn empty() { diff --git a/vulkano/src/descriptor_set/mod.rs b/vulkano/src/descriptor_set/mod.rs index f1c886f0ca..ea1b4bc506 100644 --- a/vulkano/src/descriptor_set/mod.rs +++ b/vulkano/src/descriptor_set/mod.rs @@ -88,7 +88,7 @@ use crate::{ image::{sampler::Sampler, ImageLayout}, Validated, ValidationError, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use parking_lot::{RwLock, RwLockReadGuard}; use smallvec::{smallvec, SmallVec}; use std::{ diff --git a/vulkano/src/descriptor_set/pool.rs b/vulkano/src/descriptor_set/pool.rs index 3d06ef1842..30ab7df6a8 100644 --- a/vulkano/src/descriptor_set/pool.rs +++ b/vulkano/src/descriptor_set/pool.rs @@ -9,7 +9,7 @@ use crate::{ Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, Version, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; use std::{cell::Cell, marker::PhantomData, mem::MaybeUninit, num::NonZeroU64, ptr, sync::Arc}; diff --git a/vulkano/src/pipeline/compute.rs b/vulkano/src/pipeline/compute.rs index 8766d0f08c..c7cdc2e008 100644 --- a/vulkano/src/pipeline/compute.rs +++ b/vulkano/src/pipeline/compute.rs @@ -25,7 +25,7 @@ use crate::{ shader::{spirv::ExecutionModel, DescriptorBindingRequirements}, Validated, ValidationError, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use std::{fmt::Debug, mem::MaybeUninit, num::NonZeroU64, ptr, sync::Arc}; /// A pipeline object that describes to the Vulkan implementation how it should perform compute diff --git a/vulkano/src/pipeline/graphics/color_blend.rs b/vulkano/src/pipeline/graphics/color_blend.rs index 098735b2c2..81227d49a9 100644 --- a/vulkano/src/pipeline/graphics/color_blend.rs +++ b/vulkano/src/pipeline/graphics/color_blend.rs @@ -20,7 +20,7 @@ use crate::{ pipeline::inout_interface::{ShaderInterfaceLocationInfo, ShaderInterfaceLocationWidth}, Requires, RequiresAllOf, RequiresOneOf, ValidationError, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; use std::iter; diff --git a/vulkano/src/pipeline/graphics/mod.rs b/vulkano/src/pipeline/graphics/mod.rs index a90633b2f4..526916cf92 100644 --- a/vulkano/src/pipeline/graphics/mod.rs +++ b/vulkano/src/pipeline/graphics/mod.rs @@ -113,7 +113,7 @@ use crate::{ }, Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, VulkanError, VulkanObject, }; -use ahash::{HashMap, HashSet}; +use foldhash::{HashMap, HashSet}; use fragment_shading_rate::FragmentShadingRateState; use smallvec::SmallVec; use std::{ diff --git a/vulkano/src/pipeline/graphics/vertex_input/definition.rs b/vulkano/src/pipeline/graphics/vertex_input/definition.rs index 163129e545..9294cc77a4 100644 --- a/vulkano/src/pipeline/graphics/vertex_input/definition.rs +++ b/vulkano/src/pipeline/graphics/vertex_input/definition.rs @@ -16,7 +16,7 @@ use crate::{ }, ValidationError, }; -use ahash::HashMap; +use foldhash::HashMap; use std::{borrow::Cow, collections::hash_map::Entry}; /// Trait for types that can create a [`VertexInputState`] from an [`EntryPoint`]. diff --git a/vulkano/src/pipeline/graphics/vertex_input/mod.rs b/vulkano/src/pipeline/graphics/vertex_input/mod.rs index 286d2757f5..d87d2580c1 100644 --- a/vulkano/src/pipeline/graphics/vertex_input/mod.rs +++ b/vulkano/src/pipeline/graphics/vertex_input/mod.rs @@ -104,7 +104,7 @@ use crate::{ pipeline::inout_interface::{ShaderInterfaceLocationInfo, ShaderInterfaceLocationWidth}, DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; mod buffers; diff --git a/vulkano/src/pipeline/layout.rs b/vulkano/src/pipeline/layout.rs index 6a1363e8c3..e6fe81ec5a 100644 --- a/vulkano/src/pipeline/layout.rs +++ b/vulkano/src/pipeline/layout.rs @@ -67,7 +67,7 @@ use crate::{ shader::{DescriptorBindingRequirements, ShaderStage, ShaderStages}, Validated, ValidationError, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; use std::{ array, diff --git a/vulkano/src/pipeline/mod.rs b/vulkano/src/pipeline/mod.rs index 435a6f70eb..7fe33ce398 100644 --- a/vulkano/src/pipeline/mod.rs +++ b/vulkano/src/pipeline/mod.rs @@ -16,7 +16,7 @@ use crate::{ macros::{vulkan_bitflags, vulkan_enum}, shader::DescriptorBindingRequirements, }; -use ahash::HashMap; +use foldhash::HashMap; use std::sync::Arc; pub mod cache; diff --git a/vulkano/src/pipeline/shader/inout_interface.rs b/vulkano/src/pipeline/shader/inout_interface.rs index a6fc11fe4c..a0111ce130 100644 --- a/vulkano/src/pipeline/shader/inout_interface.rs +++ b/vulkano/src/pipeline/shader/inout_interface.rs @@ -7,7 +7,7 @@ use crate::{ }, ValidationError, }; -use ahash::HashMap; +use foldhash::HashMap; use std::{collections::hash_map::Entry, convert::Infallible}; pub(crate) fn validate_interfaces_compatible( diff --git a/vulkano/src/pipeline/shader/validate_runtime.rs b/vulkano/src/pipeline/shader/validate_runtime.rs index 4ea0eb019e..30f80c9d3d 100644 --- a/vulkano/src/pipeline/shader/validate_runtime.rs +++ b/vulkano/src/pipeline/shader/validate_runtime.rs @@ -18,7 +18,7 @@ use crate::{ }, DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError, Version, }; -use ahash::HashMap; +use foldhash::HashMap; use std::{cmp::max, convert::Infallible}; pub(crate) fn validate_runtime( diff --git a/vulkano/src/render_pass/mod.rs b/vulkano/src/render_pass/mod.rs index b46a760e94..f519112a2a 100644 --- a/vulkano/src/render_pass/mod.rs +++ b/vulkano/src/render_pass/mod.rs @@ -27,7 +27,7 @@ use crate::{ Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, Version, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use smallvec::SmallVec; use std::{ cmp::max, diff --git a/vulkano/src/shader/mod.rs b/vulkano/src/shader/mod.rs index 6c58b3f1f3..2260056241 100644 --- a/vulkano/src/shader/mod.rs +++ b/vulkano/src/shader/mod.rs @@ -427,8 +427,8 @@ use crate::{ Requires, RequiresAllOf, RequiresOneOf, Validated, ValidationError, Version, VulkanError, VulkanObject, }; -use ahash::{HashMap, HashSet}; use bytemuck::bytes_of; +use foldhash::{HashMap, HashSet}; use half::f16; use smallvec::SmallVec; use spirv::ExecutionModel; diff --git a/vulkano/src/shader/reflect.rs b/vulkano/src/shader/reflect.rs index f9f938f607..6a7ac09cea 100644 --- a/vulkano/src/shader/reflect.rs +++ b/vulkano/src/shader/reflect.rs @@ -12,7 +12,7 @@ use crate::{ }, DeviceSize, Version, }; -use ahash::{HashMap, HashSet}; +use foldhash::{HashMap, HashSet}; use half::f16; use smallvec::{smallvec, SmallVec}; diff --git a/vulkano/src/shader/spirv/mod.rs b/vulkano/src/shader/spirv/mod.rs index 0e9bfff926..3dd90e3fd2 100644 --- a/vulkano/src/shader/spirv/mod.rs +++ b/vulkano/src/shader/spirv/mod.rs @@ -7,7 +7,7 @@ //! [SPIR-V specification](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html). use crate::{shader::SpecializationConstant, Version}; -use ahash::{HashMap, HashSet}; +use foldhash::{HashMap, HashSet}; use smallvec::{smallvec, SmallVec}; use std::{ borrow::Cow, diff --git a/vulkano/src/shader/spirv/specialization.rs b/vulkano/src/shader/spirv/specialization.rs index 0f6656997b..363d6a69a3 100644 --- a/vulkano/src/shader/spirv/specialization.rs +++ b/vulkano/src/shader/spirv/specialization.rs @@ -2,7 +2,7 @@ use crate::shader::{ spirv::{Decoration, Id, IdInfo, Instruction, SpecConstantInstruction}, SpecializationConstant, }; -use ahash::HashMap; +use foldhash::HashMap; use half::f16; use smallvec::{smallvec, SmallVec}; diff --git a/vulkano/src/sync/future/mod.rs b/vulkano/src/sync/future/mod.rs index 504ef1d2d7..82848c2d8c 100644 --- a/vulkano/src/sync/future/mod.rs +++ b/vulkano/src/sync/future/mod.rs @@ -101,7 +101,7 @@ use crate::{ swapchain::{self, PresentFuture, PresentInfo, Swapchain, SwapchainPresentInfo}, DeviceSize, Validated, ValidationError, VulkanError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use parking_lot::MutexGuard; use smallvec::{smallvec, SmallVec}; use std::{ diff --git a/vulkano/src/sync/pipeline.rs b/vulkano/src/sync/pipeline.rs index 288704de97..f809b2a8ac 100644 --- a/vulkano/src/sync/pipeline.rs +++ b/vulkano/src/sync/pipeline.rs @@ -9,7 +9,7 @@ use crate::{ shader::ShaderStages, DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject, }; -use ahash::HashMap; +use foldhash::HashMap; use once_cell::sync::Lazy; use smallvec::SmallVec; use std::{ops::Range, sync::Arc};