@@ -280,9 +280,7 @@ impl SpirvType<'_> {
280
280
Self :: Bool => Size :: from_bytes ( 1 ) ,
281
281
Self :: Integer ( width, _) | Self :: Float ( width) => Size :: from_bits ( width) ,
282
282
Self :: Adt { size, .. } => size?,
283
- Self :: Vector { element, count } => {
284
- cx. lookup_type ( element) . sizeof ( cx) ? * count. next_power_of_two ( ) as u64
285
- }
283
+ Self :: Vector { element, count } => cx. lookup_type ( element) . sizeof ( cx) ? * count as u64 ,
286
284
Self :: Matrix { element, count } => cx. lookup_type ( element) . sizeof ( cx) ? * count as u64 ,
287
285
Self :: Array { element, count } => {
288
286
cx. lookup_type ( element) . sizeof ( cx) ?
@@ -311,14 +309,8 @@ impl SpirvType<'_> {
311
309
Self :: Bool => Align :: from_bytes ( 1 ) . unwrap ( ) ,
312
310
Self :: Integer ( width, _) | Self :: Float ( width) => Align :: from_bits ( width as u64 ) . unwrap ( ) ,
313
311
Self :: Adt { align, .. } => align,
314
- // Vectors have size==align
315
- Self :: Vector { .. } => Align :: from_bytes (
316
- self . sizeof ( cx)
317
- . expect ( "alignof: Vectors must be sized" )
318
- . bytes ( ) ,
319
- )
320
- . expect ( "alignof: Vectors must have power-of-2 size" ) ,
321
- Self :: Array { element, .. }
312
+ Self :: Vector { element, .. }
313
+ | Self :: Array { element, .. }
322
314
| Self :: RuntimeArray { element }
323
315
| Self :: Matrix { element, .. } => cx. lookup_type ( element) . alignof ( cx) ,
324
316
Self :: Pointer { .. } => cx. tcx . data_layout . pointer_align . abi ,
0 commit comments