@@ -87,7 +87,7 @@ impl<'tcx> CodegenCx<'tcx> {
8787 } ;
8888 for ( arg_abi, hir_param) in fn_abi. args . iter ( ) . zip ( hir_params) {
8989 match arg_abi. mode {
90- PassMode :: Direct ( _) => { }
90+ PassMode :: Direct ( _) | PassMode :: Ignore => { }
9191 PassMode :: Pair ( ..) => {
9292 // FIXME(eddyb) implement `ScalarPair` `Input`s, or change
9393 // the `FnAbi` readjustment to only use `PassMode::Pair` for
@@ -103,16 +103,6 @@ impl<'tcx> CodegenCx<'tcx> {
103103 ) ;
104104 }
105105 }
106- // FIXME(eddyb) support these (by just ignoring them) - if there
107- // is any validation concern, it should be done on the types.
108- PassMode :: Ignore => self . tcx . dcx ( ) . span_fatal (
109- hir_param. ty_span ,
110- format ! (
111- "entry point parameter type not yet supported \
112- (`{}` has size `0`)",
113- arg_abi. layout. ty
114- ) ,
115- ) ,
116106 _ => span_bug ! (
117107 hir_param. ty_span,
118108 "query hooks should've made this `PassMode` impossible: {:#?}" ,
@@ -674,28 +664,37 @@ impl<'tcx> CodegenCx<'tcx> {
674664 // starting from the `value_ptr` pointing to a `value_spirv_type`
675665 // (e.g. `Input` doesn't use indirection, so we have to load from it).
676666 if let ty:: Ref ( ..) = entry_arg_abi. layout . ty . kind ( ) {
677- call_args. push ( value_ptr. unwrap ( ) ) ;
678667 match entry_arg_abi. mode {
679- PassMode :: Direct ( _) => assert_eq ! ( value_len, None ) ,
680- PassMode :: Pair ( ..) => call_args. push ( value_len. unwrap ( ) ) ,
668+ PassMode :: Direct ( _) => {
669+ assert_eq ! ( value_len, None ) ;
670+ call_args. push ( value_ptr. unwrap ( ) ) ;
671+ }
672+ PassMode :: Pair ( ..) => call_args. extend ( [ value_ptr. unwrap ( ) , value_len. unwrap ( ) ] ) ,
673+ PassMode :: Ignore => ( ) ,
681674 _ => unreachable ! ( ) ,
682675 }
683676 } else {
684- assert_matches ! ( entry_arg_abi. mode, PassMode :: Direct ( _) ) ;
685-
686- let value = match storage_class {
687- Ok ( _) => {
688- assert_eq ! ( storage_class, Ok ( StorageClass :: Input ) ) ;
689- bx. load (
690- entry_arg_abi. layout . spirv_type ( hir_param. ty_span , bx) ,
691- value_ptr. unwrap ( ) ,
692- entry_arg_abi. layout . align . abi ,
693- )
677+ match entry_arg_abi. mode {
678+ PassMode :: Ignore => { }
679+ PassMode :: Direct ( _) => {
680+ let value = match storage_class {
681+ Ok ( _) => {
682+ assert_eq ! ( storage_class, Ok ( StorageClass :: Input ) ) ;
683+ bx. load (
684+ entry_arg_abi. layout . spirv_type ( hir_param. ty_span , bx) ,
685+ value_ptr. unwrap ( ) ,
686+ entry_arg_abi. layout . align . abi ,
687+ )
688+ }
689+ Err ( SpecConstant { .. } ) => {
690+ spec_const_id. unwrap ( ) . with_type ( value_spirv_type)
691+ }
692+ } ;
693+ call_args. push ( value) ;
694+ assert_eq ! ( value_len, None ) ;
694695 }
695- Err ( SpecConstant { .. } ) => spec_const_id. unwrap ( ) . with_type ( value_spirv_type) ,
696- } ;
697- call_args. push ( value) ;
698- assert_eq ! ( value_len, None ) ;
696+ _ => unreachable ! ( ) ,
697+ }
699698 }
700699
701700 // FIXME(eddyb) check whether the storage class is compatible with the
0 commit comments