From 7cd7dce007532cc70b61468ed49b7755a3e3baab Mon Sep 17 00:00:00 2001 From: OliveThePuffin Date: Sat, 5 Jul 2025 14:22:10 -0600 Subject: [PATCH] math: fix Shared VecN comparison operators (#1419) --- src/math/vec.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/math/vec.zig b/src/math/vec.zig index 914846bf..097d5b30 100644 --- a/src/math/vec.zig +++ b/src/math/vec.zig @@ -322,23 +322,23 @@ pub fn VecShared(comptime Scalar: type, comptime VecN: type) type { } /// Element-wise a < b - pub inline fn less(a: *const VecN, b: Scalar) bool { - return a.v < b.v; + pub inline fn less(a: *const VecN, b: *const VecN) bool { + return @reduce(.And, a.v < b.v); } /// Element-wise a <= b - pub inline fn lessEq(a: *const VecN, b: Scalar) bool { - return a.v <= b.v; + pub inline fn lessEq(a: *const VecN, b: *const VecN) bool { + return @reduce(.And, a.v <= b.v); } /// Element-wise a > b - pub inline fn greater(a: *const VecN, b: Scalar) bool { - return a.v > b.v; + pub inline fn greater(a: *const VecN, b: *const VecN) bool { + return @reduce(.And, a.v > b.v); } /// Element-wise a >= b - pub inline fn greaterEq(a: *const VecN, b: Scalar) bool { - return a.v >= b.v; + pub inline fn greaterEq(a: *const VecN, b: *const VecN) bool { + return @reduce(.And, a.v >= b.v); } /// Returns a vector with all components set to the `scalar` value: