From 701ef9d98b42799368d7d3cdafb14f17513e985e Mon Sep 17 00:00:00 2001 From: Tim Harding Date: Thu, 16 Jan 2025 12:08:41 -0800 Subject: [PATCH] fix: Feature-gate bytemuck in mat3 --- neophyte-linalg/src/mat3.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/neophyte-linalg/src/mat3.rs b/neophyte-linalg/src/mat3.rs index a59243e..b1e4dfb 100644 --- a/neophyte-linalg/src/mat3.rs +++ b/neophyte-linalg/src/mat3.rs @@ -1,10 +1,10 @@ use super::vec2::Vec2; -use bytemuck::{Pod, Zeroable}; use std::ops::{Add, Mul}; /// A 3x3 matrix type #[repr(C)] -#[derive(Debug, Clone, Copy, PartialEq, Default, Pod, Zeroable)] +#[derive(Debug, Clone, Copy, PartialEq, Default)] +#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] pub struct Mat3 { // Columns x: Vec3, @@ -79,7 +79,8 @@ impl Mul for Mat3 { // Align is useful to make sure padding is handled correctly in push constant // structs #[repr(C, align(16))] -#[derive(Debug, Clone, Copy, PartialEq, Default, Pod, Zeroable)] +#[derive(Debug, Clone, Copy, PartialEq, Default)] +#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))] pub struct Vec3 { x: f32, y: f32,