Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

glam v0.33.6 breaks `Vec3A`

Đang mở
#645 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@Firestar99 đang làm issue này rồi.

Từ ngày 22/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug

PR https://github.com/bitshifter/glam-rs/pull/786 changed the definition of Vec3A to make it bytemuck::Pod:

  #[repr(align(16))]
  #[repr(C)]
  #[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
  pub struct Vec3A {
      pub x: f32,
      pub y: f32,
      pub z: f32,
+     _w: f32,
  }

So from rust-gpu's perspective, this is now a vector with 4 floats instead of 3 floats, breaking a lot of safety assumptions in our codebase.

Observed Fallout

error: error:0:0 - Expected Image Operand Grad dx to have 3 components, but given 4
         %38 = OpImageSampleDrefExplicitLod %float %37 %32 %float_1 Grad %33 %34

Mitigation

Problems:

  • glam v0.33.6 is a breaking change for rust-gpu
  • glam added _w: f32 member to get impl bytemuck::Pod for Vec3A, so reverting this is a breaking change for regular glam users
  • don't want impl Pod not to be impl on spirv

Ideas:

  • hack something in the compiler to special case glam::Vec3A
    • how do we know if a type is Vec3A? This will be a hack and not really sustainable
  • PR https://github.com/Rust-GPU/rust-gpu/pull/646 adjusts Matrix4x3 to use Vec3 instead of Vec3A. The layout of that special type is screwed up anyway, so we don't really care about it changing.
    • not a full mitigation!

Strategy:

  1. short term fix
  • special case spirv to not have _w: f32 member and not impl Pod,
  • release glam v0.33.9, fixing rust-gpu
  1. long term fix
  • glam::Vec3A:
    • remove short term fix
    • change attribute to #[spirv::vector::v1(3, f32)] to overwrite rust-gpu vector type
    • release glam v0.34.0
  • rust-gpu:
    • adjust #[spirv::vector::v1] attribute to take params to overwrite vector type
    • make rust-gpu support glam v0.34.0
    • release rust-gpu?

will update this description as I go

Ngôn ngữ chính
Rust
Star
3.4k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Rust-GPU/rust-gpu

Tất cả issue của Rust-GPU/rust-gpu

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.