gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.75k stars 935 forks source link

[wgpu-core] Replace usage of `PreHashedMap` with `FastHashMap` #6541

Closed jamienicol closed 1 week ago

jamienicol commented 1 week ago

Connections Fixes #6373

Description PreHashedMap was introduced as a performance optimization. It is, however, potentially unsound as it cannot distinguish between keys that are not equal yet have the same hash. This patch replaces its usage with a simple FastHashMap, which should be good enough. If this is found to cause real life performance issues down the line then we can figure out a better solution.

Testing cargo xtask test passes

Checklist

ErichDonGubler commented 1 week ago

@gfx-rs/wgpu: I'm not sure if we need a CHANGELOG entry here. Might be worth nothing as a General bug fix? 🤔

Wumpf commented 1 week ago

yeah would be nice to have it listed as a bugfix!

jamienicol commented 1 week ago

Added the changelog entry (and consolidated the duplicated General categories while I was there)

ErichDonGubler commented 1 week ago

Just needs conflicts resolved, and auto-merge should do the rest.

jamienicol commented 1 week ago

Just needs conflicts resolved, and auto-merge should do the rest.

done

and consolidated the duplicated General categories while I was there

heh, this was already done I just hadn't rebased