Replace fxhash with rustc-hash (#3502)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
James Liu 2023-03-01 10:46:38 -08:00 committed by GitHub
parent 87a31bb74b
commit 6ee0d4c14d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 20 deletions

View File

@ -73,6 +73,7 @@ By @teoxoy in [#3436](https://github.com/gfx-rs/wgpu/pull/3436)
#### General
- Change type of `mip_level_count` and `array_layer_count` (members of `TextureViewDescriptor` and `ImageSubresourceRange`) from `Option<NonZeroU32>` to `Option<u32>`. By @teoxoy in [#3445](https://github.com/gfx-rs/wgpu/pull/3445)
- All `fxhash` dependencies have been replaced with `rustc-hash`. By @james7132 in [#3502](https://github.com/gfx-rs/wgpu/pull/3502)
### Changes

13
Cargo.lock generated
View File

@ -1008,15 +1008,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"
@ -3058,13 +3049,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",
@ -3087,7 +3078,6 @@ dependencies = [
"d3d12",
"env_logger",
"foreign-types 0.3.2",
"fxhash",
"glow",
"glutin",
"gpu-alloc",
@ -3107,6 +3097,7 @@ dependencies = [
"range-alloc",
"raw-window-handle 0.5.0",
"renderdoc-sys",
"rustc-hash",
"smallvec",
"thiserror",
"wasm-bindgen",

View File

@ -58,7 +58,7 @@ codespan-reporting = "0.11"
ddsfile = "0.5"
env_logger = "0.10"
futures-intrusive = "0.4"
fxhash = "0.2.1"
rustc-hash = "1.1.0"
glam = "0.21.3"
image = { version = "0.24", default-features = false, features = ["png"] }
libloading = "0.7"

View File

@ -54,7 +54,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"

View File

@ -388,9 +388,10 @@ macro_rules! gfx_select {
/// Fast hash map used internally.
type FastHashMap<K, V> =
std::collections::HashMap<K, V, std::hash::BuildHasherDefault<fxhash::FxHasher>>;
std::collections::HashMap<K, V, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
/// Fast hash set used internally.
type FastHashSet<K> = std::collections::HashSet<K, std::hash::BuildHasherDefault<fxhash::FxHasher>>;
type FastHashSet<K> =
std::collections::HashSet<K, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
#[inline]
pub(crate) fn get_lowest_common_denom(a: u32, b: u32) -> u32 {

View File

@ -60,7 +60,7 @@ thiserror = "1"
# backends common
arrayvec = "0.7"
fxhash = "0.2.1"
rustc-hash = "1.1"
log = "0.4"
# backend: Gles

View File

@ -16,7 +16,7 @@ type ShaderStage<'a> = (
naga::ShaderStage,
&'a crate::ProgrammableStage<'a, super::Api>,
);
type NameBindingMap = fxhash::FxHashMap<String, (super::BindingRegister, u8)>;
type NameBindingMap = rustc_hash::FxHashMap<String, (super::BindingRegister, u8)>;
struct CompilationContext<'a> {
layout: &'a super::PipelineLayout,

View File

@ -762,7 +762,7 @@ struct CommandState {
/// See [`device::CompiledShader::sized_bindings`] for more details.
///
/// [`ResourceBinding`]: naga::ResourceBinding
storage_buffer_length_map: fxhash::FxHashMap<naga::ResourceBinding, wgt::BufferSize>,
storage_buffer_length_map: rustc_hash::FxHashMap<naga::ResourceBinding, wgt::BufferSize>,
work_group_memory_sizes: Vec<u32>,
push_constants: Vec<u32>,

View File

@ -252,8 +252,8 @@ struct DeviceShared {
downlevel_flags: wgt::DownlevelFlags,
private_caps: PrivateCapabilities,
workarounds: Workarounds,
render_passes: Mutex<fxhash::FxHashMap<RenderPassKey, vk::RenderPass>>,
framebuffers: Mutex<fxhash::FxHashMap<FramebufferKey, vk::Framebuffer>>,
render_passes: Mutex<rustc_hash::FxHashMap<RenderPassKey, vk::RenderPass>>,
framebuffers: Mutex<rustc_hash::FxHashMap<FramebufferKey, vk::Framebuffer>>,
}
pub struct Device {