From 04dfa80266b3efd0f44acfa941e6a20a16bf00ae Mon Sep 17 00:00:00 2001 From: Ashley Hauck Date: Tue, 15 Jun 2021 09:43:13 +0200 Subject: [PATCH] Nuke arithmetic.rs (#666) --- crates/spirv-std/src/arch.rs | 2 - crates/spirv-std/src/arch/arithmetic.rs | 502 ------------------------ tests/ui/arch/f_add.rs | 10 - tests/ui/arch/f_div.rs | 10 - tests/ui/arch/f_mod.rs | 10 - tests/ui/arch/f_mul.rs | 10 - tests/ui/arch/f_negate.rs | 8 - tests/ui/arch/f_rem.rs | 10 - tests/ui/arch/f_sub.rs | 10 - tests/ui/arch/i_add.rs | 10 - tests/ui/arch/i_mul.rs | 10 - tests/ui/arch/i_sub.rs | 10 - tests/ui/arch/s_div.rs | 10 - tests/ui/arch/s_mod.rs | 10 - tests/ui/arch/s_negate.rs | 8 - tests/ui/arch/s_rem.rs | 10 - tests/ui/arch/u_div.rs | 10 - tests/ui/arch/u_mod.rs | 10 - tests/ui/arch/vector_times_scalar.rs | 8 - 19 files changed, 668 deletions(-) delete mode 100644 crates/spirv-std/src/arch/arithmetic.rs delete mode 100644 tests/ui/arch/f_add.rs delete mode 100644 tests/ui/arch/f_div.rs delete mode 100644 tests/ui/arch/f_mod.rs delete mode 100644 tests/ui/arch/f_mul.rs delete mode 100644 tests/ui/arch/f_negate.rs delete mode 100644 tests/ui/arch/f_rem.rs delete mode 100644 tests/ui/arch/f_sub.rs delete mode 100644 tests/ui/arch/i_add.rs delete mode 100644 tests/ui/arch/i_mul.rs delete mode 100644 tests/ui/arch/i_sub.rs delete mode 100644 tests/ui/arch/s_div.rs delete mode 100644 tests/ui/arch/s_mod.rs delete mode 100644 tests/ui/arch/s_negate.rs delete mode 100644 tests/ui/arch/s_rem.rs delete mode 100644 tests/ui/arch/u_div.rs delete mode 100644 tests/ui/arch/u_mod.rs delete mode 100644 tests/ui/arch/vector_times_scalar.rs diff --git a/crates/spirv-std/src/arch.rs b/crates/spirv-std/src/arch.rs index 30a3391a40..2e16c94cbf 100644 --- a/crates/spirv-std/src/arch.rs +++ b/crates/spirv-std/src/arch.rs @@ -5,14 +5,12 @@ //! no additional safety checks beyond type-checking. use crate::{scalar::Scalar, vector::Vector}; -mod arithmetic; mod barrier; mod demote_to_helper_invocation_ext; mod derivative; mod primitive; mod ray_tracing; -pub use arithmetic::*; pub use barrier::*; pub use demote_to_helper_invocation_ext::*; pub use derivative::*; diff --git a/crates/spirv-std/src/arch/arithmetic.rs b/crates/spirv-std/src/arch/arithmetic.rs deleted file mode 100644 index fa58e08517..0000000000 --- a/crates/spirv-std/src/arch/arithmetic.rs +++ /dev/null @@ -1,502 +0,0 @@ -// The new preferred style is still to use `unsafe` blocks in `unsafe` functions -// but the compiler/clippy hasn't caught up to that style yet, so we just -// disable the lint. -#![allow(unused_unsafe)] - -use crate::{ - float::Float, - integer::{Integer, SignedInteger, UnsignedInteger}, - vector::Vector, -}; - -/// Signed-integer subtract of `operand` from zero. Results are computed -/// per component. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpSNegate")] -#[inline] -pub fn s_negate_vector(operand: V) -> V -where - S: SignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%operand = OpLoad typeof*{operand} {operand}", - "%result = OpSNegate typeof*{operand} %operand", - "OpStore {result} %result", - operand = in(reg) &operand, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point subtract of `operand` from zero. Results are computed -/// per component. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFNegate")] -#[inline] -pub fn f_negate_vector(operand: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%operand = OpLoad typeof*{operand} {operand}", - "%result = OpFNegate typeof*{operand} %operand", - "OpStore {result} %result", - operand = in(reg) &operand, - result = in(reg) &mut result, - } - } - - result -} - -/// Integer addition of `x` and `y`. Results are computed per component. -/// -/// # Safety -/// The resulting value is undefined if the computation would result -/// in overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpIAdd")] -#[inline] -pub unsafe fn i_add_vector(x: V, y: V) -> V -where - I: Integer, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpIAdd typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point addition of `x` and `y`. Results are computed per component. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFAdd")] -#[inline] -pub fn f_add_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFAdd typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Signed-integer subtract of `x` from `y`. Results are computed per component. -/// -/// # Safety -/// The resulting value is undefined if the computation would result -/// in underflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpISub")] -#[inline] -pub fn i_sub_vector(x: V, y: V) -> V -where - I: Integer, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpISub typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point subtract of `x` from `y`. Results are computed per component. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFSub")] -#[inline] -pub fn f_sub_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFSub typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Integer multiplication of `x` and `y`. Results are computed per component. -/// -/// # Safety -/// The resulting value is undefined if the computation would result -/// in underflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpIMul")] -#[inline] -pub fn i_mul_vector(x: V, y: V) -> V -where - I: Integer, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpIMul typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point multiplication of `x` and `y`. Results are computed -/// per component. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFMul")] -#[inline] -pub fn f_mul_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFMul typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Unsigned-integer division of `x` from `y`. Results are computed -/// per component. -/// -/// # Safety -/// The resulting value is undefined if any component of `y` is `0`. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpUDiv")] -#[inline] -pub unsafe fn u_div_vector(x: V, y: V) -> V -where - I: UnsignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpUDiv typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Signed-integer division of `x` from `y`. Results are computed -/// per component. -/// -/// # Safety -/// The resulting value is undefined if any component of `y` is `0`, or if a -/// component of `y` is `-1` and the dividing component of `x` is -/// minimum representable value for its type, causing signed overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpSDiv")] -#[inline] -pub unsafe fn s_div_vector(x: V, y: V) -> V -where - I: SignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpSDiv typeof*{y} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point division of `x` from `y`. Results are computed -/// per component. -/// -/// # Safety -/// The resulting value is undefined if any component of `y` is `0.0`. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFDiv")] -#[inline] -pub fn f_div_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFDiv typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Unsigned modulo operation of `x` modulo `y`. Results are computed -/// per component. -/// -/// # Safety -/// The resulting value is undefined if `y` is `0`. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpUMod")] -#[inline] -pub fn u_mod_vector(x: V, y: V) -> V -where - I: UnsignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpUMod typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Signed-integer remainder operation for getting the remainder from `x / y` -/// whose sign matches the sign of `x`. -/// -/// # Safety -/// Behavior is undefined if `y` is 0, or if `y` is -1 and `x` is the minimum -/// representable value for the type, causing signed overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpSRem")] -#[inline] -pub fn s_rem_vector(x: V, y: V) -> V -where - I: SignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpSRem typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Signed-integer modulo operation from `x` modulo `y`, whose sign matches the -/// sign of `y`. Results are computed per component. -/// -/// # Safety -/// Behavior is undefined if `y` is 0, or if `y` is -1 and `x` is the minimum -/// representable value for the type, causing signed overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpSMod")] -#[inline] -pub fn s_mod_vector(x: V, y: V) -> V -where - I: SignedInteger, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpSMod typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point remainder operation for getting the remainder from `x / y` -/// whose sign matches the sign of `x`. Results are computed per component. -/// -/// # Safety -/// Behavior is undefined if `y` is 0, or if `y` is -1 and `x` is the minimum -/// representable value for the type, causing signed overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFRem")] -#[inline] -pub fn f_rem_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFRem typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Floating-point modulo operation from `x` modulo `y`, whose sign matches the -/// sign of `y`. Results are computed per component. -/// -/// # Safety -/// Behavior is undefined if `y` is 0, or if `y` is -1 and `x` is the minimum -/// representable value for the type, causing signed overflow. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpFMod")] -#[inline] -pub fn f_mod_vector(x: V, y: V) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%x = OpLoad typeof*{x} {x}", - "%y = OpLoad typeof*{y} {y}", - "%result = OpFMod typeof*{x} %x %y", - "OpStore {result} %result", - x = in(reg) &x, - y = in(reg) &y, - result = in(reg) &mut result, - } - } - - result -} - -/// Scale a floating-point `vector` by `scalar`. Each component of `vector` is -/// multiplied by `scalar`. -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpVectorTimesScalar")] -#[inline] -pub fn vector_times_scalar(vector: V, scalar: F) -> V -where - F: Float, - V: Vector, -{ - let mut result = V::default(); - - unsafe { - asm! { - "%vector = OpLoad typeof*{vector} {vector}", - "%scalar = OpLoad typeof*{scalar} {scalar}", - "%result = OpVectorTimesScalar typeof*{vector} %vector %scalar", - "OpStore {result} %result", - vector = in(reg) &vector, - scalar = in(reg) &scalar, - result = in(reg) &mut result, - } - } - - result -} diff --git a/tests/ui/arch/f_add.rs b/tests/ui/arch/f_add.rs deleted file mode 100644 index 369301036e..0000000000 --- a/tests/ui/arch/f_add.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5.0; - let y = 2.0; - let vx = glam::Vec2::new(2.0, 5.0); - let vy = glam::Vec2::new(5.0, 2.0); - assert!(spirv_std::arch::f_add_vector(vx, vy) == glam::Vec2::new(7.0, 7.0)); -} diff --git a/tests/ui/arch/f_div.rs b/tests/ui/arch/f_div.rs deleted file mode 100644 index 12a9fa2d77..0000000000 --- a/tests/ui/arch/f_div.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 10.0; - let y = 2.0; - let vx = glam::Vec2::new(10.0, 10.0); - let vy = glam::Vec2::new(2.0, 2.0); - assert!(spirv_std::arch::f_div_vector(vx, vy) == glam::Vec2::new(5.0, 5.0)); -} diff --git a/tests/ui/arch/f_mod.rs b/tests/ui/arch/f_mod.rs deleted file mode 100644 index 34c4dad047..0000000000 --- a/tests/ui/arch/f_mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 10.0; - let y = 2.0; - let vx = glam::Vec2::new(10.0, 10.0); - let vy = glam::Vec2::new(2.0, 2.0); - assert!(spirv_std::arch::f_mod_vector(vx, vy) == glam::Vec2::new(0.0, 0.0)); -} diff --git a/tests/ui/arch/f_mul.rs b/tests/ui/arch/f_mul.rs deleted file mode 100644 index d946d7bbb7..0000000000 --- a/tests/ui/arch/f_mul.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5.0; - let y = 2.0; - let vx = glam::Vec2::new(5.0, 2.0); - let vy = glam::Vec2::new(2.0, 5.0); - assert!(spirv_std::arch::f_mul_vector(vx, vy) == glam::Vec2::new(10.0, 10.0)); -} diff --git a/tests/ui/arch/f_negate.rs b/tests/ui/arch/f_negate.rs deleted file mode 100644 index 064c5473b9..0000000000 --- a/tests/ui/arch/f_negate.rs +++ /dev/null @@ -1,8 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let operand: f32 = -5.0; - let vector = glam::Vec2::new(-5.0, -0.0); - assert!(spirv_std::arch::f_negate_vector(vector) == glam::Vec2::new(5.0, 0.0)); -} diff --git a/tests/ui/arch/f_rem.rs b/tests/ui/arch/f_rem.rs deleted file mode 100644 index 77a370daff..0000000000 --- a/tests/ui/arch/f_rem.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = -10.0; - let y = -2.0; - let vx = glam::Vec2::new(-10.0, -10.0); - let vy = glam::Vec2::new(-2.0, -2.0); - assert!(spirv_std::arch::f_mod_vector(vx, vy) == glam::Vec2::new(-0.0, -0.0)); -} diff --git a/tests/ui/arch/f_sub.rs b/tests/ui/arch/f_sub.rs deleted file mode 100644 index 21bbcc04c7..0000000000 --- a/tests/ui/arch/f_sub.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5.0; - let y = 5.0; - let vx = glam::Vec2::new(5.0, 7.0); - let vy = glam::Vec2::new(5.0, 7.0); - assert!(spirv_std::arch::f_sub_vector(vx, vy) == glam::Vec2::new(0.0, 0.0)); -} diff --git a/tests/ui/arch/i_add.rs b/tests/ui/arch/i_add.rs deleted file mode 100644 index 5b4b39f291..0000000000 --- a/tests/ui/arch/i_add.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5; - let y = 2; - let vx = glam::IVec2::new(2, 5); - let vy = glam::IVec2::new(5, 2); - assert!(unsafe { spirv_std::arch::i_add_vector(vx, vy) } == glam::IVec2::new(7, 7)); -} diff --git a/tests/ui/arch/i_mul.rs b/tests/ui/arch/i_mul.rs deleted file mode 100644 index 03257fce84..0000000000 --- a/tests/ui/arch/i_mul.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5; - let y = 2; - let vx = glam::IVec2::new(5, 2); - let vy = glam::IVec2::new(2, 5); - assert!(spirv_std::arch::i_mul_vector(vx, vy) == glam::IVec2::new(10, 10)); -} diff --git a/tests/ui/arch/i_sub.rs b/tests/ui/arch/i_sub.rs deleted file mode 100644 index e536ae191b..0000000000 --- a/tests/ui/arch/i_sub.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 5; - let y = 5; - let vx = glam::IVec2::new(5, 7); - let vy = glam::IVec2::new(5, 7); - assert!(spirv_std::arch::i_sub_vector(vx, vy) == glam::IVec2::new(0, 0)); -} diff --git a/tests/ui/arch/s_div.rs b/tests/ui/arch/s_div.rs deleted file mode 100644 index c10f867cd2..0000000000 --- a/tests/ui/arch/s_div.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 10; - let y = 2; - let vx = glam::IVec2::new(10, 10); - let vy = glam::IVec2::new(2, 2); - assert!(unsafe { spirv_std::arch::s_div_vector(vx, vy) } == glam::IVec2::new(5, 5)); -} diff --git a/tests/ui/arch/s_mod.rs b/tests/ui/arch/s_mod.rs deleted file mode 100644 index 04f443cf26..0000000000 --- a/tests/ui/arch/s_mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = 10; - let y = 2; - let vx = glam::IVec2::new(10, 10); - let vy = glam::IVec2::new(2, 2); - assert!(spirv_std::arch::s_mod_vector(vx, vy) == glam::IVec2::new(0, 0)); -} diff --git a/tests/ui/arch/s_negate.rs b/tests/ui/arch/s_negate.rs deleted file mode 100644 index 364c3c548b..0000000000 --- a/tests/ui/arch/s_negate.rs +++ /dev/null @@ -1,8 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let operand: i32 = -5; - let vector = glam::IVec2::new(-5, -0); - assert!(spirv_std::arch::s_negate_vector(vector) == glam::IVec2::new(5, 0)); -} diff --git a/tests/ui/arch/s_rem.rs b/tests/ui/arch/s_rem.rs deleted file mode 100644 index f9ea07d812..0000000000 --- a/tests/ui/arch/s_rem.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x = -10; - let y = -2; - let vx = glam::IVec2::new(-10, -10); - let vy = glam::IVec2::new(-2, -2); - assert!(spirv_std::arch::s_rem_vector(vx, vy) == glam::IVec2::new(-0, -0)); -} diff --git a/tests/ui/arch/u_div.rs b/tests/ui/arch/u_div.rs deleted file mode 100644 index 5601eb45d4..0000000000 --- a/tests/ui/arch/u_div.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x: u32 = 10; - let y = 2; - let vx = glam::UVec2::new(10, 10); - let vy = glam::UVec2::new(2, 2); - assert!(unsafe { spirv_std::arch::u_div_vector(vx, vy) } == glam::UVec2::new(5, 5)); -} diff --git a/tests/ui/arch/u_mod.rs b/tests/ui/arch/u_mod.rs deleted file mode 100644 index e6eef084e3..0000000000 --- a/tests/ui/arch/u_mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let x: u32 = 10; - let y = 2; - let vx = glam::UVec2::new(10, 10); - let vy = glam::UVec2::new(2, 2); - assert!(spirv_std::arch::u_mod_vector(vx, vy) == glam::UVec2::new(0, 0)); -} diff --git a/tests/ui/arch/vector_times_scalar.rs b/tests/ui/arch/vector_times_scalar.rs deleted file mode 100644 index a17b1db5ce..0000000000 --- a/tests/ui/arch/vector_times_scalar.rs +++ /dev/null @@ -1,8 +0,0 @@ -// build-pass - -#[spirv(fragment)] -pub fn main() { - let vector = glam::Vec2::new(10.0, 10.0); - let scalar = 2.0; - assert!(spirv_std::arch::vector_times_scalar(vector, scalar) == glam::Vec2::new(20.0, 20.0)); -}