mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[spv-out] Use FastIndexMap for Frontend::switch_cases.
This commit is contained in:
@@ -40,7 +40,7 @@ use function::*;
|
||||
use crate::{
|
||||
arena::{Arena, Handle, UniqueArena},
|
||||
proc::{Alignment, Layouter},
|
||||
FastHashMap, FastHashSet,
|
||||
FastHashMap, FastHashSet, FastIndexMap,
|
||||
};
|
||||
|
||||
use num_traits::cast::FromPrimitive;
|
||||
@@ -596,11 +596,7 @@ pub struct Frontend<I> {
|
||||
/// use that target block id.
|
||||
///
|
||||
/// Used to preserve allocations between instruction parsing.
|
||||
switch_cases: indexmap::IndexMap<
|
||||
spirv::Word,
|
||||
(BodyIndex, Vec<i32>),
|
||||
std::hash::BuildHasherDefault<rustc_hash::FxHasher>,
|
||||
>,
|
||||
switch_cases: FastIndexMap<spirv::Word, (BodyIndex, Vec<i32>)>,
|
||||
|
||||
/// Tracks access to gl_PerVertex's builtins, it is used to cull unused builtins since initializing those can
|
||||
/// affect performance and the mere presence of some of these builtins might cause backends to error since they
|
||||
@@ -641,7 +637,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
||||
dummy_functions: Arena::new(),
|
||||
function_call_graph: GraphMap::new(),
|
||||
options: options.clone(),
|
||||
switch_cases: indexmap::IndexMap::default(),
|
||||
switch_cases: FastIndexMap::default(),
|
||||
gl_per_vertex_builtin_access: FastHashSet::default(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user