adding SIMD vector specializations
Some checks failed
Build / build (push) Failing after 29s
Test / build (push) Failing after 55s

This commit is contained in:
2026-01-21 14:52:37 +01:00
parent 45adad727d
commit 19687251b0
7 changed files with 455 additions and 56 deletions

View File

@@ -42,6 +42,12 @@ pub fn main() !void {
const tri_h = bottom_y - top_y;
const max_half_w = @divTrunc(screen_width, 2) - margin_x;
var timer = try std.time.Timer.start();
defer {
const ns = timer.lap();
std.log.info("Took {d:.3}s to render", .{@as(f32, @floatFromInt(ns)) / std.time.ns_per_s});
}
for (top_y..bottom_y) |y| {
const t: f32 = @as(f32, @floatFromInt(y - top_y)) / @as(f32, @floatFromInt(tri_h));
const half_w: usize = @intFromFloat((t * @as(f32, @floatFromInt(max_half_w))) + 0.5);
@@ -79,7 +85,7 @@ pub fn main() !void {
try window.updateSurface();
std.Thread.sleep(10_000_000_000);
std.Thread.sleep(2_000_000_000);
}
std.log.info("Successfully executed", .{});
}