Skip to content

RFC: glam-ification of spirv-std #393

@Firestar99

Description

@Firestar99

How are people feeling on replacing all the trivial impl 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:
    pub fn u16x2_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:

pub fn subgroup_broadcast_first<T: VectorOrScalar>(value: T) -> T {

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions