From 5ffb311d722429596a17c3d4099823a2522115ae Mon Sep 17 00:00:00 2001 From: james7132 Date: Sun, 19 Feb 2023 17:59:42 -0800 Subject: [PATCH 1/3] Replace fxhash with rustc-hash --- Cargo.lock | 13 ++----------- Cargo.toml | 2 +- wgpu-core/Cargo.toml | 2 +- wgpu-core/src/lib.rs | 4 ++-- wgpu-hal/Cargo.toml | 2 +- wgpu-hal/src/gles/device.rs | 2 +- wgpu-hal/src/metal/mod.rs | 2 +- wgpu-hal/src/vulkan/mod.rs | 4 ++-- 8 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb01f676ed..71348c669e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -986,15 +986,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "getrandom" version = "0.1.16" @@ -2935,13 +2926,13 @@ dependencies = [ "bit-vec", "bitflags", "codespan-reporting", - "fxhash", "log", "naga", "parking_lot 0.12.1", "profiling", "raw-window-handle 0.5.0", "ron", + "rustc-hash", "serde", "smallvec", "thiserror", @@ -2964,7 +2955,6 @@ dependencies = [ "d3d12", "env_logger", "foreign-types 0.3.2", - "fxhash", "glow", "glutin", "gpu-alloc", @@ -2983,6 +2973,7 @@ dependencies = [ "range-alloc", "raw-window-handle 0.5.0", "renderdoc-sys", + "rustc-hash", "smallvec", "thiserror", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index bf4231ddec..b08d83c9f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ codespan-reporting = "0.11" ddsfile = "0.5" env_logger = "0.9" futures-intrusive = "0.4" -fxhash = "0.2.1" +rustc-hash = "1.1.0" glam = "0.21.3" libloading = "0.7" libc = "0.2" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index bc2c212fc7..12eff34aca 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -55,7 +55,7 @@ arrayvec = "0.7" bitflags = "1" bit-vec = "0.6" codespan-reporting = "0.11" -fxhash = "0.2.1" +rustc-hash = "1.1" log = "0.4" # parking_lot 0.12 switches from `winapi` to `windows`; permit either parking_lot = ">=0.11,<0.13" diff --git a/wgpu-core/src/lib.rs b/wgpu-core/src/lib.rs index ff9f3d4b65..f7d7fb0c33 100644 --- a/wgpu-core/src/lib.rs +++ b/wgpu-core/src/lib.rs @@ -386,9 +386,9 @@ macro_rules! gfx_select { /// Fast hash map used internally. type FastHashMap = - std::collections::HashMap>; + std::collections::HashMap>; /// Fast hash set used internally. -type FastHashSet = std::collections::HashSet>; +type FastHashSet = std::collections::HashSet>; #[inline] pub(crate) fn get_lowest_common_denom(a: u32, b: u32) -> u32 { diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index b5d6b6e645..b8a10de894 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -54,7 +54,7 @@ thiserror = "1" # backends common arrayvec = "0.7" -fxhash = "0.2.1" +rustc-hash = "1.1" log = "0.4" renderdoc-sys = { version = "0.7.1", optional = true } diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index fa4802f9d8..da626a11cb 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -14,7 +14,7 @@ type ShaderStage<'a> = ( naga::ShaderStage, &'a crate::ProgrammableStage<'a, super::Api>, ); -type NameBindingMap = fxhash::FxHashMap; +type NameBindingMap = rustc_hash::FxHashMap; struct CompilationContext<'a> { layout: &'a super::PipelineLayout, diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index 37f101cff7..f28cb790c3 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -755,7 +755,7 @@ struct CommandState { /// See [`device::CompiledShader::sized_bindings`] for more details. /// /// [`ResourceBinding`]: naga::ResourceBinding - storage_buffer_length_map: fxhash::FxHashMap, + storage_buffer_length_map: rustc_hash::FxHashMap, work_group_memory_sizes: Vec, push_constants: Vec, diff --git a/wgpu-hal/src/vulkan/mod.rs b/wgpu-hal/src/vulkan/mod.rs index a30dbec224..5d54ba6876 100644 --- a/wgpu-hal/src/vulkan/mod.rs +++ b/wgpu-hal/src/vulkan/mod.rs @@ -308,8 +308,8 @@ struct DeviceShared { downlevel_flags: wgt::DownlevelFlags, private_caps: PrivateCapabilities, workarounds: Workarounds, - render_passes: Mutex>, - framebuffers: Mutex>, + render_passes: Mutex>, + framebuffers: Mutex>, } pub struct Device { From 2b9a48a02b83618063d649b4dd87176d2335913d Mon Sep 17 00:00:00 2001 From: james7132 Date: Sun, 19 Feb 2023 18:05:06 -0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f80cfc5db4..de2d7c6d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,6 +122,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non - Dereferencing a buffer view is now marked inline. By @Wumpf in [#3307](https://github.com/gfx-rs/wgpu/pull/3307) - The `strict_assert` family of macros was moved to `wgpu-types`. By @i509VCB in [#3051](https://github.com/gfx-rs/wgpu/pull/3051) - Add missing `DEPTH_BIAS_CLAMP` and `FULL_DRAW_INDEX_UINT32` downlevel flags. By @teoxoy in [#3316](https://github.com/gfx-rs/wgpu/pull/3316) +- All `fxhash` dependencies have been replaced with `rustc-hash`. By @james7132 in [#3502](https://github.com/gfx-rs/wgpu/pull/3502) #### WebGPU From ff06ba22e8d7a36be76fbee765928b9e2dab1013 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 1 Mar 2023 13:32:23 -0500 Subject: [PATCH 3/3] Format --- wgpu-core/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgpu-core/src/lib.rs b/wgpu-core/src/lib.rs index 8e30e068b2..d099f26e9d 100644 --- a/wgpu-core/src/lib.rs +++ b/wgpu-core/src/lib.rs @@ -390,7 +390,8 @@ macro_rules! gfx_select { type FastHashMap = std::collections::HashMap>; /// Fast hash set used internally. -type FastHashSet = std::collections::HashSet>; +type FastHashSet = + std::collections::HashSet>; #[inline] pub(crate) fn get_lowest_common_denom(a: u32, b: u32) -> u32 {