Skip to content

glam v0.33.6 breaks Matrix4x3 #645

Description

@Firestar99

glam v0.33.6 breaks rust-gpu's Matrix4x3 layout, causing certain raytracing-related intrinsics to miscompile into invalid spirv. See compiletest ray_query_get_intersection_object_to_world_khr breaking after glam update, as seen in this CI of PR #630

PR bitshifter/glam-rs#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. Which should also have further implications beyond just Matrix4x3, like we should be seeing all kinds of Vec3A usage suddenly think they're Vec4s. But I haven't seen any other changes in our compiletests.

PR #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.

will update this description as I go

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions