fixing sinh and cosh
Build / build (push) Successful in 1m8s
Test / build (push) Successful in 10m31s

This commit is contained in:
2026-06-11 12:33:20 +02:00
parent c868a4481b
commit 75099f7e1d
2 changed files with 5 additions and 11 deletions
+2 -2
View File
@@ -298,7 +298,7 @@ fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp) type {
.Atanh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.atanh(x), .Atanh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.atanh(x),
.Ceil => @ceil(x), .Ceil => @ceil(x),
.Cos => @cos(x), .Cos => @cos(x),
.Cosh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.cosh(x), .Cosh => if (TT == f16) RuntimeError.UnsupportedSpirV else (@exp(x) + @exp(-x)) / 2, // std.math.cosh is not precise enough for Vulkan CTS
.Degrees => std.math.radiansToDegrees(x), .Degrees => std.math.radiansToDegrees(x),
.Exp => @exp(x), .Exp => @exp(x),
.Exp2 => @exp2(x), .Exp2 => @exp2(x),
@@ -313,7 +313,7 @@ fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp) type {
.Round => @round(x), .Round => @round(x),
.RoundEven => roundEven(TT, x), .RoundEven => roundEven(TT, x),
.Sin => @sin(x), .Sin => @sin(x),
.Sinh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.sinh(x), .Sinh => if (TT == f16) RuntimeError.UnsupportedSpirV else (@exp(x) - @exp(-x)) / 2, // std.math.sinh is not precise enough for Vulkan CTS
.Sqrt => @sqrt(x), .Sqrt => @sqrt(x),
.Tan => @tan(x), .Tan => @tan(x),
.Tanh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.tanh(x), .Tanh => if (TT == f16) RuntimeError.UnsupportedSpirV else std.math.tanh(x),
+3 -9
View File
@@ -474,13 +474,7 @@ pub fn getMemberCounts(self: *const Self) usize {
return 0; return 0;
} }
pub fn flushPtr(self: *Self, allocator: std.mem.Allocator) RuntimeError!void { pub inline fn flushPtr(self: *Self, allocator: std.mem.Allocator) RuntimeError!void {
if (self.variant) |*variant| { const value = self.getValue() catch return;
switch (variant.*) { try value.flushPtr(allocator);
.Constant => |*c| try c.value.flushPtr(allocator),
.Variable => |*v| try v.value.flushPtr(allocator),
.AccessChain => |*a| try a.value.flushPtr(allocator),
else => {},
}
}
} }