Skip to content

Commit 680317c

Browse files
committed
Matrix4x3: impl Debug and Display like a Mat4
1 parent 169005c commit 680317c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/spirv-std/src/matrix.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! a set of common SPIR-V Matrices, used for intrinsics
22
3+
use core::fmt::{Debug, Display, Formatter};
34
use glam::{Affine3A, Mat3, Mat3A, Mat4, Vec3, Vec3A};
45

56
/// A Matrix with 4 columns of [`Vec3`], very similar to glam's [`Affine3A`].
@@ -76,3 +77,15 @@ impl Matrix4x3 {
7677
Mat4::from(self.to_affine3a())
7778
}
7879
}
80+
81+
impl Debug for Matrix4x3 {
82+
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
83+
Debug::fmt(&self.to_mat4(), f)
84+
}
85+
}
86+
87+
impl Display for Matrix4x3 {
88+
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
89+
Display::fmt(&self.to_mat4(), f)
90+
}
91+
}

0 commit comments

Comments
 (0)