diff --git a/examples/shaders/shared/src/lib.rs b/examples/shaders/shared/src/lib.rs index 0d90ef118a..0d0e4fb77d 100644 --- a/examples/shaders/shared/src/lib.rs +++ b/examples/shaders/shared/src/lib.rs @@ -6,7 +6,7 @@ #![register_attr(spirv)] use core::f32::consts::PI; -use spirv_std::glam::Vec3; +use spirv_std::glam::{vec3, Vec3}; // Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but // we tie #[no_std] above to the same condition, so it's fine. @@ -27,11 +27,11 @@ pub fn saturate(x: f32) -> f32 { } pub fn pow(v: Vec3, power: f32) -> Vec3 { - Vec3::new(v.x.powf(power), v.y.powf(power), v.z.powf(power)) + vec3(v.x.powf(power), v.y.powf(power), v.z.powf(power)) } pub fn exp(v: Vec3) -> Vec3 { - Vec3::new(v.x.exp(), v.y.exp(), v.z.exp()) + vec3(v.x.exp(), v.y.exp(), v.z.exp()) } /// Based on: https://seblagarde.wordpress.com/2014/12/01/inverse-trigonometric-functions-gpu-optimization-for-amd-gcn-architecture/ diff --git a/examples/shaders/simplest-shader/src/lib.rs b/examples/shaders/simplest-shader/src/lib.rs index 46cd057a76..343ebd71cd 100644 --- a/examples/shaders/simplest-shader/src/lib.rs +++ b/examples/shaders/simplest-shader/src/lib.rs @@ -2,13 +2,13 @@ #![feature(register_attr)] #![register_attr(spirv)] -use spirv_std::glam::Vec4; +use spirv_std::glam::{vec4, Vec4}; use spirv_std::storage_class::{Input, Output}; #[allow(unused_attributes)] #[spirv(fragment)] pub fn main_fs(mut output: Output) { - output.store(Vec4::new(1.0, 0.0, 0.0, 1.0)) + output.store(vec4(1.0, 0.0, 0.0, 1.0)) } #[allow(unused_attributes)] @@ -18,7 +18,7 @@ pub fn main_vs( #[spirv(position)] mut out_pos: Output, ) { let vert_id = vert_id.load(); - out_pos.store(Vec4::new( + out_pos.store(vec4( (vert_id - 1) as f32, ((vert_id & 1) * 2 - 1) as f32, 0.0,