SimdUpgradable

Trait SimdUpgradable 

Source
pub trait SimdUpgradable: GenericVector3
where Self::Simd: GenericVector3<Scalar = Self::Scalar>,
{ type Simd; // Required methods fn to_simd(self) -> Self::Simd; fn from_simd(simd: Self::Simd) -> Self; }
Expand description

Trait for vector types that can be upgraded to a SIMD-optimized variant for computation, then downgraded back.

Required Associated Types§

Source

type Simd

The SIMD-optimized version of this vector type. For glam::Vec3, this is glam::Vec3A. For glam::DVec3, this is glam::DVec3 itself (no-op).

Required Methods§

Source

fn to_simd(self) -> Self::Simd

Convert to the SIMD-optimized variant

Source

fn from_simd(simd: Self::Simd) -> Self

Convert from the SIMD-optimized variant

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SimdUpgradable for Vec3

Source§

fn to_simd(self) -> Self::Simd

Convert to the SIMD-optimized variant

Source§

fn from_simd(simd: Self::Simd) -> Self

Convert from the SIMD-optimized variant

Source§

type Simd = Vec3A

Source§

impl SimdUpgradable for DVec3

Source§

fn to_simd(self) -> Self::Simd

Convert to the SIMD-optimized variant (this particular variant is a NOP)

Source§

fn from_simd(simd: Self::Simd) -> Self

Convert from the SIMD-optimized variant (this particular variant is a NOP)

Source§

type Simd = DVec3

Implementors§