@@ -367,14 +367,20 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
367
367
SpirvType :: Float ( inst. operands [ 0 ] . unwrap_literal_bit32 ( ) ) . def ( self . span ( ) , self )
368
368
}
369
369
Op :: TypeStruct => {
370
- self . err ( "OpTypeStruct in asm! is not supported yet " ) ;
370
+ self . err ( "` OpTypeStruct` in asm! is not supported" ) ;
371
371
return ;
372
372
}
373
- Op :: TypeVector => SpirvType :: Vector {
374
- element : inst. operands [ 0 ] . unwrap_id_ref ( ) ,
375
- count : inst. operands [ 1 ] . unwrap_literal_bit32 ( ) ,
373
+ Op :: TypeVector => {
374
+ self . struct_err (
375
+ "`OpTypeVector` in asm! is not supported, since `#[spirv(vector)]` structs can \
376
+ create different vector types due to varying size and alignment",
377
+ )
378
+ . with_note (
379
+ "pass `glam::VecN` as parameters and use `typeof{foo}` to resolve vector type" ,
380
+ )
381
+ . emit ( ) ;
382
+ return ;
376
383
}
377
- . def ( self . span ( ) , self ) ,
378
384
Op :: TypeMatrix => SpirvType :: Matrix {
379
385
element : inst. operands [ 0 ] . unwrap_id_ref ( ) ,
380
386
count : inst. operands [ 1 ] . unwrap_literal_bit32 ( ) ,
@@ -717,13 +723,6 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
717
723
( TyPat :: Void , SpirvType :: Void ) => Ok ( [ None ] ) ,
718
724
( TyPat :: Pointer ( _, pat) , SpirvType :: Pointer { pointee : ty, .. } )
719
725
| ( TyPat :: Vector ( pat) , SpirvType :: Vector { element : ty, .. } )
720
- | (
721
- TyPat :: Vector4 ( pat) ,
722
- SpirvType :: Vector {
723
- element : ty,
724
- count : 4 ,
725
- } ,
726
- )
727
726
| (
728
727
TyPat :: Image ( pat) ,
729
728
SpirvType :: Image {
@@ -762,12 +761,6 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
762
761
}
763
762
. def ( DUMMY_SP , cx) ,
764
763
765
- TyPat :: Vector4 ( pat) => SpirvType :: Vector {
766
- element : subst_ty_pat ( cx, pat, ty_vars, leftover_operands) ?,
767
- count : 4 ,
768
- }
769
- . def ( DUMMY_SP , cx) ,
770
-
771
764
TyPat :: SampledImage ( pat) => SpirvType :: SampledImage {
772
765
image_type : subst_ty_pat ( cx, pat, ty_vars, leftover_operands) ?,
773
766
}
0 commit comments