Skip to content

Conversation

Firestar99
Copy link
Member

@Firestar99 Firestar99 commented Sep 17, 2025

Requires #394 (due to conflicts)

see #393

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 {

closes #393

Base automatically changed from safe-intrinsics to main September 17, 2025 16:13
Copy link
Contributor

@schell schell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@Firestar99 Firestar99 added this pull request to the merge queue Sep 18, 2025
Merged via the queue into main with commit ca2ea7b Sep 18, 2025
13 checks passed
@Firestar99 Firestar99 deleted the glam-ification branch September 18, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: glam-ification of spirv-std
2 participants