@@ -123,15 +123,15 @@ unsafe impl<
123
123
{
124
124
}
125
125
126
- macro_rules! impl_device_copy_vek {
127
- ( $( $strukt: ident) ,* $( , ) ?) => {
126
+ macro_rules! impl_device_copy_generic {
127
+ ( $( $( $ strukt: ident) ::+ ) ,* $( , ) ?) => {
128
128
$(
129
- unsafe impl <T : DeviceCopy > DeviceCopy for $strukt<T > { }
129
+ unsafe impl <T : DeviceCopy > DeviceCopy for $( $ strukt) ::+ <T > { }
130
130
) *
131
131
}
132
132
}
133
133
134
- macro_rules! impl_device_copy_glam {
134
+ macro_rules! impl_device_copy {
135
135
( $( $strukt: ty) ,* $( , ) ?) => {
136
136
$(
137
137
unsafe impl DeviceCopy for $strukt { }
@@ -143,23 +143,31 @@ macro_rules! impl_device_copy_glam {
143
143
use vek:: * ;
144
144
145
145
#[ cfg( feature = "vek" ) ]
146
- impl_device_copy_vek ! {
146
+ impl_device_copy_generic ! {
147
147
Vec2 , Vec3 , Vec4 , Extent2 , Extent3 , Rgb , Rgba ,
148
148
Mat2 , Mat3 , Mat4 ,
149
149
CubicBezier2 , CubicBezier3 ,
150
150
Quaternion ,
151
151
}
152
152
153
153
#[ cfg( feature = "glam" ) ]
154
- impl_device_copy_glam ! {
154
+ impl_device_copy ! {
155
155
glam:: Vec2 , glam:: Vec3 , glam:: Vec4 , glam:: IVec2 , glam:: IVec3 , glam:: IVec4 ,
156
156
}
157
157
158
158
#[ cfg( feature = "mint" ) ]
159
- impl_device_copy_glam ! {
160
- mint:: Vector2 <i16 >, mint:: Vector2 <i32 >, mint:: Vector2 <f32 >,
161
- mint:: Vector3 <u16 >, mint:: Vector3 <u32 >, mint:: Vector3 <i16 >, mint:: Vector3 <i32 >, mint:: Vector3 <f32 >,
162
- mint:: Vector4 <i16 >, mint:: Vector4 <i32 >, mint:: Vector4 <f32 >,
163
- mint:: ColumnMatrix2 <f32 >, mint:: ColumnMatrix3 <f32 >, mint:: ColumnMatrix4 <f32 >, mint:: ColumnMatrix3x4 <f32 >,
164
- mint:: RowMatrix2 <f32 >, mint:: RowMatrix3 <f32 >, mint:: RowMatrix4 <f32 >, mint:: RowMatrix3x4 <f32 >,
159
+ impl_device_copy_generic ! {
160
+ mint:: Vector2 , mint:: Vector3 , mint:: Vector4 ,
161
+ mint:: ColumnMatrix2 , mint:: ColumnMatrix3 , mint:: ColumnMatrix4 , mint:: ColumnMatrix3x4 ,
162
+ mint:: RowMatrix2 , mint:: RowMatrix3 , mint:: RowMatrix4 , mint:: RowMatrix3x4 ,
163
+ }
164
+
165
+ #[ cfg( feature = "half" ) ]
166
+ unsafe impl DeviceCopy for half:: f16 { }
167
+ #[ cfg( feature = "half" ) ]
168
+ unsafe impl DeviceCopy for half:: bf16 { }
169
+
170
+ #[ cfg( feature = "num-complex" ) ]
171
+ impl_device_copy_generic ! {
172
+ num_complex:: Complex
165
173
}
0 commit comments