From 5b30cd85665e7e3a638b61a0985e9b9d16994f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 18 Oct 2025 14:23:58 +0200 Subject: [PATCH 1/4] =?UTF-8?q?feat:=E2=80=AFadd=20encase=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/parry2d-f64/Cargo.toml | 4 ++-- crates/parry2d/Cargo.toml | 6 ++++-- crates/parry3d-f64/Cargo.toml | 4 ++-- crates/parry3d/Cargo.toml | 6 ++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/crates/parry2d-f64/Cargo.toml b/crates/parry2d-f64/Cargo.toml index f8894ad5..3a5b15ab 100644 --- a/crates/parry2d-f64/Cargo.toml +++ b/crates/parry2d-f64/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -[lints] -workspace = true +#[lints] +#workspace = true [features] default = ["required-features", "std", "spade"] diff --git a/crates/parry2d/Cargo.toml b/crates/parry2d/Cargo.toml index fd2cd1a8..58821ad6 100644 --- a/crates/parry2d/Cargo.toml +++ b/crates/parry2d/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -[lints] -workspace = true +#[lints] +#workspace = true [features] default = ["required-features", "std", "spade"] @@ -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-f64/Cargo.toml b/crates/parry3d-f64/Cargo.toml index 71abff0f..1c6b26fd 100644 --- a/crates/parry3d-f64/Cargo.toml +++ b/crates/parry3d-f64/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -[lints] -workspace = true +#[lints] +#workspace = true [features] default = ["required-features", "std", "spade"] diff --git a/crates/parry3d/Cargo.toml b/crates/parry3d/Cargo.toml index 92b1c1e8..7ad9dad7 100644 --- a/crates/parry3d/Cargo.toml +++ b/crates/parry3d/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -[lints] -workspace = true +#[lints] +#workspace = true [features] default = ["required-features", "std", "spade"] @@ -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 From 7539f3c6445fcada95c42705154dacaf049e958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 18 Oct 2025 14:25:07 +0200 Subject: [PATCH 2/4] feat: implement ShaderType for Ball, Capsule, Cuboid, Cylinder, Segment, and Triangle --- src/shape/ball.rs | 1 + src/shape/capsule.rs | 1 + src/shape/cuboid.rs | 1 + src/shape/cylinder.rs | 1 + src/shape/segment.rs | 1 + src/shape/triangle.rs | 1 + 6 files changed, 6 insertions(+) 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), From dadc25c619512d1a86a1675b7451efddc6d2592a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 2 Nov 2025 14:49:17 +0100 Subject: [PATCH 3/4] fix: re-enable workspace lints --- crates/parry2d-f64/Cargo.toml | 4 ++-- crates/parry2d/Cargo.toml | 4 ++-- crates/parry3d-f64/Cargo.toml | 4 ++-- crates/parry3d/Cargo.toml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/parry2d-f64/Cargo.toml b/crates/parry2d-f64/Cargo.toml index 3a5b15ab..f8894ad5 100644 --- a/crates/parry2d-f64/Cargo.toml +++ b/crates/parry2d-f64/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -#[lints] -#workspace = true +[lints] +workspace = true [features] default = ["required-features", "std", "spade"] diff --git a/crates/parry2d/Cargo.toml b/crates/parry2d/Cargo.toml index 58821ad6..0df356ab 100644 --- a/crates/parry2d/Cargo.toml +++ b/crates/parry2d/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -#[lints] -#workspace = true +[lints] +workspace = true [features] default = ["required-features", "std", "spade"] diff --git a/crates/parry3d-f64/Cargo.toml b/crates/parry3d-f64/Cargo.toml index 1c6b26fd..71abff0f 100644 --- a/crates/parry3d-f64/Cargo.toml +++ b/crates/parry3d-f64/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -#[lints] -#workspace = true +[lints] +workspace = true [features] default = ["required-features", "std", "spade"] diff --git a/crates/parry3d/Cargo.toml b/crates/parry3d/Cargo.toml index 7ad9dad7..b94ca488 100644 --- a/crates/parry3d/Cargo.toml +++ b/crates/parry3d/Cargo.toml @@ -16,8 +16,8 @@ edition = "2021" [badges] maintenance = { status = "actively-developed" } -#[lints] -#workspace = true +[lints] +workspace = true [features] default = ["required-features", "std", "spade"] From 96ae235604d9504de557568862956dc6c9db732e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 2 Nov 2025 14:52:19 +0100 Subject: [PATCH 4/4] fix lint warning --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) 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]