Support Option<T>
Author: fu5haCreated Nov 12, 2020Updated Nov 13, 2024
Labelst: bugc: rustc_codegen_spirvs: qptr may fix
Expected Behaviour
Be able to use Option<Mat4>
Example & Steps To Reproduce
Use an Option that contains a value larger than some threshold
pub fn from_mat4(t: &Mat4) -> Option<Self> {
let (scale3, rotation, translation) = t.to_scale_rotation_translation();
if scale3.abs_diff_eq(Vec3::splat(1.0), 1e-4) {
Some(Self::from_rotation_translation(rotation, translation))
} else {
None
}
}
Source: EmbarkStudios/rust-gpu