Skip to content

Commit

Permalink
Replace fxhash with rustc-hash (#3502)
Browse files Browse the repository at this point in the history
Co-authored-by: Connor Fitzgerald <[email protected]>
  • Loading branch information
james7132 and cwfitzgerald authored Mar 1, 2023
1 parent 87a31bb commit 6ee0d4c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 2 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ thiserror = "1"

# backends common
arrayvec = "0.7"
fxhash = "0.2.1"
rustc-hash = "1.1"
log = "0.4"

# backend: Gles
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/metal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
4 changes: 2 additions & 2 deletions wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6ee0d4c

Please sign in to comment.