@@ -431,7 +431,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
431431 . map ( |idx| self . constant_u32 ( self . span ( ) , idx) . def ( self ) )
432432 . collect :: < Vec < _ > > ( ) ;
433433 self . emit ( )
434- . access_chain ( leaf_ptr_ty, None , ptr. def ( self ) , indices)
434+ . in_bounds_access_chain ( leaf_ptr_ty, None , ptr. def ( self ) , indices)
435435 . unwrap ( )
436436 . with_type ( leaf_ptr_ty)
437437 } ;
@@ -1417,7 +1417,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
14171417 . collect :: < Vec < _ > > ( ) ;
14181418 return self
14191419 . emit ( )
1420- . access_chain ( result_type, None , original_ptr, indices)
1420+ . in_bounds_access_chain ( result_type, None , original_ptr, indices)
14211421 . unwrap ( )
14221422 . with_type ( result_type) ;
14231423 }
@@ -1435,7 +1435,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
14351435 }
14361436 let index_const = self . constant_u32 ( self . span ( ) , idx as u32 ) . def ( self ) ;
14371437 self . emit ( )
1438- . access_chain (
1438+ . in_bounds_access_chain (
14391439 result_type,
14401440 None ,
14411441 ptr. def ( self ) ,
@@ -1744,7 +1744,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
17441744 . map ( |idx| self . constant_u32 ( self . span ( ) , idx) . def ( self ) )
17451745 . collect :: < Vec < _ > > ( ) ;
17461746 self . emit ( )
1747- . access_chain ( dest_ty, None , ptr. def ( self ) , indices)
1747+ . in_bounds_access_chain ( dest_ty, None , ptr. def ( self ) , indices)
17481748 . unwrap ( )
17491749 . with_type ( dest_ty)
17501750 } else {
@@ -2683,7 +2683,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
26832683 enum Inst < ' tcx , ID > {
26842684 Bitcast ( ID , ID ) ,
26852685 CompositeExtract ( ID , ID , u32 ) ,
2686- AccessChain ( ID , ID , SpirvConst < ' tcx , ' tcx > ) ,
26872686 InBoundsAccessChain ( ID , ID , SpirvConst < ' tcx , ' tcx > ) ,
26882687 Store ( ID , ID ) ,
26892688 Load ( ID , ID ) ,
@@ -2721,9 +2720,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
27212720 Some (
27222721 match ( inst. class . opcode , inst. result_id , & id_operands[ ..] ) {
27232722 ( Op :: Bitcast , Some ( r) , & [ x] ) => Inst :: Bitcast ( r, x) ,
2724- ( Op :: AccessChain , Some ( r) , & [ p, i] ) => {
2725- Inst :: AccessChain ( r, p, self . builder . lookup_const_by_id ( i) ?)
2726- }
27272723 ( Op :: InBoundsAccessChain , Some ( r) , & [ p, i] ) => {
27282724 Inst :: InBoundsAccessChain (
27292725 r,
@@ -2887,9 +2883,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
28872883 array_base_ptr,
28882884 SpirvConst :: U32 ( array_idx) ,
28892885 ) ,
2890- Inst :: AccessChain ( a_ptr, a_base_ptr, SpirvConst :: U32 ( 0 ) ) ,
2886+ Inst :: InBoundsAccessChain ( a_ptr, a_base_ptr, SpirvConst :: U32 ( 0 ) ) ,
28912887 Inst :: Store ( a_st_dst, a_st_val) ,
2892- Inst :: AccessChain ( b_ptr, b_base_ptr, SpirvConst :: U32 ( 1 ) ) ,
2888+ Inst :: InBoundsAccessChain ( b_ptr, b_base_ptr, SpirvConst :: U32 ( 1 ) ) ,
28932889 Inst :: Store ( b_st_dst, b_st_val) ,
28942890 ] if array_base_ptr == rt_args_array_ptr_id
28952891 && array_idx as usize == rt_arg_idx
0 commit comments