diff --git a/Cargo.toml b/Cargo.toml index 9e0524fe..aa82d173 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,8 @@ rust.unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(feature, values("dim2", "dim3", "f32", "f64"))', # "wavefront" is only used for 3D crates. 'cfg(feature, values("wavefront"))', + # "encase" is only used in f32 crates. + 'cfg(feature, values("encase"))' ] } [workspace.lints.clippy] diff --git a/crates/parry2d/Cargo.toml b/crates/parry2d/Cargo.toml index fd2cd1a8..0df356ab 100644 --- a/crates/parry2d/Cargo.toml +++ b/crates/parry2d/Cargo.toml @@ -56,6 +56,7 @@ parallel = ["rayon"] alloc = ["nalgebra/alloc", "hashbrown"] spade = ["dep:spade", "alloc"] improved_fixed_point_support = [] +encase = [ "dep:encase", "nalgebra/encase" ] # Do not enable this feature directly. It is automatically # enabled with the "simd-stable" or "simd-nightly" feature. @@ -93,6 +94,7 @@ thiserror = { version = "2", default-features = false } ena = { version = "0.14.3", optional = true, default-features = false } smallvec = "1" foldhash = { version = "0.2", default-features = false } +encase = { version = "0.12", optional = true } [dev-dependencies] simba = { version = "0.9", default-features = false } diff --git a/crates/parry3d/Cargo.toml b/crates/parry3d/Cargo.toml index 92b1c1e8..b94ca488 100644 --- a/crates/parry3d/Cargo.toml +++ b/crates/parry3d/Cargo.toml @@ -57,6 +57,7 @@ wavefront = ["obj"] alloc = ["nalgebra/alloc", "hashbrown"] spade = ["dep:spade", "alloc"] improved_fixed_point_support = [] +encase = [ "dep:encase", "nalgebra/encase" ] # Do not enable this feature directly. It is automatically # enabled with the "simd-stable" or "simd-nightly" feature. @@ -97,6 +98,7 @@ ena = { version = "0.14.3", optional = true, default-features = false } smallvec = "1" static_assertions = "1" foldhash = { version = "0.2", default-features = false } +encase = { version = "0.12", optional = true } # NOTE: needed only for element_min for SIMD BVH ray-casting. # can be removed once `wide` supports it (and allows filtering-out the diff --git a/src/shape/ball.rs b/src/shape/ball.rs index d3022ffa..f2defc35 100644 --- a/src/shape/ball.rs +++ b/src/shape/ball.rs @@ -39,6 +39,7 @@ use crate::shape::SupportMap; /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize), diff --git a/src/shape/capsule.rs b/src/shape/capsule.rs index cfd924cb..1d245a5c 100644 --- a/src/shape/capsule.rs +++ b/src/shape/capsule.rs @@ -11,6 +11,7 @@ use rkyv::{bytecheck, CheckBytes}; #[derive(Copy, Clone, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes), diff --git a/src/shape/cuboid.rs b/src/shape/cuboid.rs index 66fbd451..8646cbdc 100644 --- a/src/shape/cuboid.rs +++ b/src/shape/cuboid.rs @@ -58,6 +58,7 @@ use rkyv::{bytecheck, CheckBytes}; /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes), diff --git a/src/shape/cylinder.rs b/src/shape/cylinder.rs index a236f7d4..7aa9136d 100644 --- a/src/shape/cylinder.rs +++ b/src/shape/cylinder.rs @@ -66,6 +66,7 @@ use rkyv::{bytecheck, CheckBytes}; /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes), diff --git a/src/shape/segment.rs b/src/shape/segment.rs index 480f7ab9..cb1fbc09 100644 --- a/src/shape/segment.rs +++ b/src/shape/segment.rs @@ -60,6 +60,7 @@ use rkyv::{bytecheck, CheckBytes}; /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes), diff --git a/src/shape/triangle.rs b/src/shape/triangle.rs index eb1dfa1b..fdbdad39 100644 --- a/src/shape/triangle.rs +++ b/src/shape/triangle.rs @@ -74,6 +74,7 @@ use rkyv::{bytecheck, CheckBytes}; /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] +#[cfg_attr(feature = "encase", derive(encase::ShaderType))] #[cfg_attr( feature = "rkyv", derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize, CheckBytes),