How are people feeling on replacing all the trivialimpl Vector<f32, 4> with a plain glam::Vec4?
pro:
- clearer to read
- functions returning
V: Vector don't need any explicit declarations that it's a Vec2, in case of ambiguity:
| pubfnu16x2_to_vec2_unorm<V:Vector<f32,2>>(int:u32) -> V{ |
contra:
- Both
Vec3 and Vec3A impl Vector<f32, 3>, so you can't use them interchangeably anymore. We expect most people to use Vec3, and conversion is a trivial From::from.
Cases where we are generic on the vector element type, or element count, or both should remain as generic, eg:
| pubfnsubgroup_broadcast_first<T:VectorOrScalar>(value:T) -> T{ |
How are people feeling on replacing all the trivial
impl Vector<f32, 4>with a plainglam::Vec4?pro:
V: Vectordon't need any explicit declarations that it's aVec2, in case of ambiguity:rust-gpu/crates/spirv-std/src/float.rs
Line 225 in fb42c2b
contra:
Vec3andVec3AimplVector<f32, 3>, so you can't use them interchangeably anymore. We expect most people to useVec3, and conversion is a trivialFrom::from.Cases where we are generic on the vector element type, or element count, or both should remain as generic, eg:
rust-gpu/crates/spirv-std/src/arch/subgroup.rs
Line 336 in fb42c2b