Replies: 2 comments 2 replies
-
Here's a rough and untested example of what I'm talking about: https://rust.godbolt.org/z/r17xrsa9e |
Beta Was this translation helpful? Give feedback.
-
I would be happy to accept PRs for SIMD optimised casts where is makes sense. The current implementations of At the moment I haven't written any SIMD acceleration for f64, this wouldn't prevent accepting optimised casts for
glam-rs/src/core/sse2/float.rs Lines 36 to 47 in 88e4538 I think for network compression of glam types it would make sense to do this in a separate crate, at least initially. There are a few different ways to approach this and what works best can vary from game to game, so I feel like it would be better to flesh this out outside of glam. For SIMD it should be a no-op to convert between glam types like |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm interested in putting together some optimized methods for serializing Vector 3 and Quaternion types for network encoding, mainly for multiplayer game servers. The typical approach I've seen and am following for float encoding is to:
I've been working on optimizing these steps for singular f32 and f64 types. For (2), I've found that these methods can significantly outperform Rust's built-in libm call for f32/f64::round(). For (3), I'd like to stick to the same saturating cast behavior that the
as
keyword does (see reference), and for (4) I'm using a variation on the optimized prefix-byte varint encoding that the speedy library uses to reduce the write operation to just a few shifts.I'd like to expand this to a SIMD-accelerated version for Vector 3 and Quaternion, and so I've been exploring ways to achieve a "shopping list" of SIMD operations. In particular, I need:
as
.This is all pretty borderline for glam's scope, certainly, but I'd be curious to see if this would be an interesting set of things to add or support for glam, or if you had any thoughts on how to go about implementing them. I'll also need to figure out ways to do some other things, if they're even possible:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions