glam v0.33.6 breaks `Vec3A`
@Firestar99 がすでに取り組んでいます。
2026年9月22日 から。
評価
この issue はまだ評価されていません。
説明
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
- breaks rust-gpu's
Matrix4x3layout, causing certain raytracing-related intrinsics to miscompile into invalid spirv. See compiletestray_query_get_intersection_object_to_world_khrbreaking after glam update, as seen in this CI of PR https://github.com/Rust-GPU/rust-gpu/pull/630 - This CI of PR https://github.com/Rust-GPU/rust-gpu/pull/646 shows compiletest
sample_gradientfailing, showing potential higher 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: f32member to getimpl bytemuck::Pod for Vec3A, so reverting this is a breaking change for regular glam users - don't want
impl Podnot 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
- how do we know if a type is
- PR https://github.com/Rust-GPU/rust-gpu/pull/646 adjusts
Matrix4x3to useVec3instead ofVec3A. The layout of that special type is screwed up anyway, so we don't really care about it changing.- not a full mitigation!
Strategy:
- short term fix
- special case spirv to not have
_w: f32member and not implPod, - release glam v0.33.9, fixing rust-gpu
- 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?
- adjust
will update this description as I go
- 主要言語
- Rust
- スター
- 3.4k
- フォーク
- 126
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Rust-GPU/rust-gpu のほかの issue
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
enhancement
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Rust-GPU/rust-gpu の issue をすべて見る
似ている issue
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
n0-computer/iroh#4550 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
paritytech/zombienet-sdk#591 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
farion1231/cc-switch#7638 · コメント 1 件 ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100