@@ -6,14 +6,13 @@ use {conversions as conv, command, native as n};
6
6
use native;
7
7
8
8
use std:: borrow:: Borrow ;
9
- use std:: collections:: hash_map:: { Entry , HashMap } ;
9
+ use std:: collections:: hash_map:: Entry ;
10
10
use std:: ops:: Range ;
11
11
use std:: path:: Path ;
12
12
use std:: sync:: { Arc , Condvar , Mutex , RwLock } ;
13
13
use std:: { cmp, mem, slice, time} ;
14
14
15
15
use hal:: { self , error, image, pass, format, mapping, memory, buffer, pso, query, window} ;
16
- use hal:: backend:: FastHashMap ;
17
16
use hal:: device:: { BindError , OutOfMemory , FramebufferError , ShaderError } ;
18
17
use hal:: memory:: Properties ;
19
18
use hal:: pool:: CommandPoolCreateFlags ;
@@ -496,7 +495,7 @@ impl Device {
496
495
{
497
496
Ok ( library) => Ok ( n:: ShaderModule :: Compiled {
498
497
library,
499
- entry_point_map : FastHashMap :: default ( ) ,
498
+ entry_point_map : n :: EntryPointMap :: default ( ) ,
500
499
} ) ,
501
500
Err ( err) => Err ( ShaderError :: CompilationFailed ( err. into ( ) ) ) ,
502
501
}
@@ -506,8 +505,8 @@ impl Device {
506
505
& self ,
507
506
raw_data : & [ u8 ] ,
508
507
primitive_class : MTLPrimitiveTopologyClass ,
509
- overrides : & HashMap < msl :: ResourceBindingLocation , msl :: ResourceBinding > ,
510
- ) -> Result < ( metal:: Library , FastHashMap < String , spirv :: EntryPoint > ) , ShaderError > {
508
+ overrides : & n :: ResourceOverrideMap ,
509
+ ) -> Result < ( metal:: Library , n :: EntryPointMap ) , ShaderError > {
511
510
// spec requires "codeSize must be a multiple of 4"
512
511
assert_eq ! ( raw_data. len( ) & 3 , 0 ) ;
513
512
@@ -528,7 +527,10 @@ impl Device {
528
527
compiler_options. resolve_specialized_array_lengths = true ;
529
528
compiler_options. vertex . invert_y = true ;
530
529
// fill the overrides
531
- compiler_options. resource_binding_overrides = overrides. clone ( ) ;
530
+ compiler_options. resource_binding_overrides = overrides
531
+ . iter ( )
532
+ . map ( |( key, value) | ( key. clone ( ) , value. clone ( ) ) )
533
+ . collect ( ) ;
532
534
533
535
ast. set_compiler_options ( & compiler_options)
534
536
. map_err ( |err| {
@@ -557,7 +559,7 @@ impl Device {
557
559
ShaderError :: CompilationFailed ( msg)
558
560
} ) ?;
559
561
560
- let mut entry_point_map = FastHashMap :: default ( ) ;
562
+ let mut entry_point_map = n :: EntryPointMap :: default ( ) ;
561
563
for entry_point in entry_points {
562
564
info ! ( "Entry point {:?}" , entry_point) ;
563
565
let cleansed = ast. get_cleansed_entry_point_name ( & entry_point. name , entry_point. execution_model )
@@ -727,7 +729,7 @@ impl hal::Device<Backend> for Device {
727
729
( ShaderStageFlags :: FRAGMENT , spirv:: ExecutionModel :: Fragment , Counters { buffers : 0 , textures : 0 , samplers : 0 } ) ,
728
730
( ShaderStageFlags :: COMPUTE , spirv:: ExecutionModel :: GlCompute , Counters { buffers : 0 , textures : 0 , samplers : 0 } ) ,
729
731
] ;
730
- let mut res_overrides = HashMap :: new ( ) ;
732
+ let mut res_overrides = n :: ResourceOverrideMap :: default ( ) ;
731
733
732
734
for ( set_index, set_layout) in set_layouts. into_iter ( ) . enumerate ( ) {
733
735
match set_layout. borrow ( ) {
@@ -1185,7 +1187,7 @@ impl hal::Device<Backend> for Device {
1185
1187
let ( library, entry_point_map) = self . compile_shader_library (
1186
1188
raw_data,
1187
1189
MTLPrimitiveTopologyClass :: Unspecified ,
1188
- & HashMap :: new ( ) ,
1190
+ & n :: ResourceOverrideMap :: default ( ) ,
1189
1191
) ?;
1190
1192
n:: ShaderModule :: Compiled {
1191
1193
library,
0 commit comments