Skip to content

support glam v0.34 - #661

Draft
Firestar99 wants to merge 2 commits into
disallow_vec3a_intrinsicsfrom
glam_0_34
Draft

Firestar99 wants to merge 2 commits into
disallow_vec3a_intrinsicsfrom
glam_0_34

Conversation

@Firestar99

Copy link
Copy Markdown
Member

Requires #660 bitshifter/glam-rs#898

Updating from glam v0.34.0 to v0.34.1 (with bitshifter/glam-rs#898) is a breaking change for rust-gpu users. Thus, we will never offer rust-gpu with anything lower than glam v0.34.1.

How this will get merged:

@Firestar99 Firestar99 changed the title support glam 0.34 support glam v0.34 Oct 5, 2026
bitshifter pushed a commit to bitshifter/glam-rs that referenced this pull request Oct 6, 2026
Related rust-gpu PRs: Rust-GPU/rust-gpu#660
Rust-GPU/rust-gpu#661

# Objective

**Main change: don't special case `Vec3A` as a rust-gpu SPIR-V vector**
* changes it's SPIR-V representation from `OpTypeVector %f32 3` to
`OpTypeStruct %f32 %f32 %f32 %f32`
* this makes `Vec3A` incompatible with certain SPIR-V intrinsics 
* rust-gpu removes it's `unsafe impl Vector for Vec3A` to disallow it's
use
* Migration: use `Vec3` instead and convert back and forward with
`Vec3::to_vec3a()` and `Vec3A::to_vec3()`
* as it's no longer special cased, glam can add back the `_w: f32`
member and derive `Pod` and such
* so we can revert the hack from
#861
  
Best reviewed commit by commit, as the first commit is just a revert
(that needed a little manual conflict resolution) and the second commit
is the actual 3 line change.

**I would like this change to be released as a minor patch like
v0.34.1**. Upgrading from 0.34.0 to 0.34.1 is *technically* a breaking
change for any rust-gpu user, but rust-gpu doesn't support glam 0.34.0
yet. So when I do add support for 0.34, I can just require at least
version 0.34.1 to mitigate it.

To prevent future breakages: Changing the members of a struct annotated
with `#[rust_gpu::vector::v1]` is considered a breaking change for
rust-gpu, even if they're just private. When I added those annotations,
I assumed that'll basically never happen, but
#786 changed `Vec3A` to have a
private `_w: f32` member.

## Checklist

- [ ] `cargo run -p ci` passes.
- [ ] PR title follows [Conventional
Commits](CONTRIBUTING.md#pull-request-titles); mark breaking changes
with `!`.

This branch has not been deployed

No deployments
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.

2 participants