Skip to content

Commit 5f4dea6

Browse files
bitshifterozkriff
andauthored
Newsletter 11: glam 0.9 (#196)
* glam 0.9 breaking changes. * Newsletter 11: glam: Fmt tweaks * Newsletter 11: glam: Move section up Co-authored-by: Andrey Lesnikov <ozkriff@gmail.com>
1 parent a93199f commit 5f4dea6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

content/posts/newsletter-011/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,33 @@ channel in the [PSP Homebrew discord server](https://discord.gg/WY8XhDG).
417417

418418
[rust-psp]: https://github.com/overdrivenpotato/rust-psp
419419

420+
### [glam]
421+
422+
[glam] is a simple and fast linear algebra crate for games and graphics.
423+
424+
This month [glam 0.9] was published to crates.io. This update is a breaking
425+
change from 0.8.
426+
427+
In 0.9 the `Vec3` type was changed from being a 128 byte SIMD vector type to a
428+
tuple of three floats. This changes the size of `Vec3` from 16 bytes to 12 bytes
429+
and the alignment from 16 bytes to 4 bytes. This might not effect all users but
430+
if `Vec3` was used in a context where the size or alignment mattered, such as in
431+
FFI or as input to shaders, this could cause breakage.
432+
433+
The SIMD parts of `Vec3` were moved to a new type, `Vec3A` (`A` for Aligned)
434+
which is 16 byte aligned and thus 16 bytes in size. The `Vec3A` type is still
435+
there for users who want the performance benefits of the SIMD implementation.
436+
437+
The motivation for this change was that it is potentially surprising and
438+
confusing for new users that the `Vec3` type was not 12 bytes. Also it's common
439+
that users needed a `Vec3` that was just 12 bytes.
440+
441+
While glam is reasonably stable it has not yet reached a 1.0 release so it
442+
seemed like now is the time to address such issues in the API.
443+
444+
[glam]: https://github.com/bitshifter/glam-rs
445+
[glam 0.9]: https://github.com/bitshifter/glam-rs/blob/master/CHANGELOG.md#090---2020-06-28
446+
420447
### [This Month in Mun][mun-june]
421448

422449
![Language Server Diagnostics in action](mun-languageserver.gif)

0 commit comments

Comments
 (0)