Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
old_c*
zig-out*
zig-cache*
.zig-cache*
6 changes: 3 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void {
});

_ = b.addModule("zilliam", .{
.root_source_file = std.Build.LazyPath.relative("src/geo.zig"),
.root_source_file = b.path("src/geo.zig"),
.imports = &.{
.{ .name = "comath", .module = comath_dep.module("comath") },
},
Expand All @@ -30,7 +30,7 @@ pub fn build(b: *std.Build) void {
}) |val| {
const exe = b.addExecutable(.{
.name = val[1],
.root_source_file = .{ .path = val[0] },
.root_source_file = b.path(val[0]),
.target = target,
.optimize = optimize,
});
Expand All @@ -55,7 +55,7 @@ pub fn build(b: *std.Build) void {

inline for (.{ "src/blades.zig", "src/pga.zig", "src/glsl_gen.zig" }) |name| {
const unit_tests = b.addTest(.{
.root_source_file = .{ .path = name },
.root_source_file = b.path(name),
.target = target,
.optimize = optimize,
});
Expand Down
7 changes: 4 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
.{
.name = "zilliam",
.name = .zilliam,
.version = "0.0.1",
.fingerprint = 0xdf5e6bd2071db6c2,
.paths = .{
"src",
"build.zig",
"build.zig.zon",
},
.dependencies = .{
.comath = .{
.url = "https://github.com/InKryption/comath/archive/07fd1acfe20e05e260ede883b762c878e8724dac.tar.gz",
.hash = "1220bbc10c8f8a4ed95e44a1e79b32caebc4ebb3ae952fe1341505be45f9d176ee11",
.url = "https://github.com/InKryption/comath/archive/d0459e71f5bca0aa0780fe4f2b169b9c42e1d99a.zip",
.hash = "122072a9b21eb30185fe60c7f42ff1cb2d5ad9b0f0fbe7b22c32355feafa8d620412",
},
},
}
2 changes: 1 addition & 1 deletion src/benchmark_blade.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn main() !void {
var b = Bivector{};
b.val[b_i] = 1;

const res = @call(.never_inline, mul_abi, .{ .{ .val = a.val }, .{ .val = b.val } }).val;
const res = @call(.never_inline, mul_abi, .{ packed_vec{ .val = a.val }, packed_vec{ .val = b.val } }).val;
checksum += res;
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/geo.zig
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub fn Algebra(comptime T: type, comptime pos_dim: usize, comptime neg_dim: usiz
struct_fields[i] = .{
.name = null_terminated,
.type = Self,
.default_value = @ptrCast(&res),
.default_value_ptr = @ptrCast(&res),
.is_comptime = true,
.alignment = 1,
};
Expand All @@ -220,7 +220,7 @@ pub fn Algebra(comptime T: type, comptime pos_dim: usize, comptime neg_dim: usiz
}

const blade_struct = @Type(.{
.Struct = .{
.@"struct" = .{
.layout = .auto,
.fields = &struct_fields,
.decls = &.{},
Expand All @@ -229,9 +229,9 @@ pub fn Algebra(comptime T: type, comptime pos_dim: usize, comptime neg_dim: usiz
}){};

const blade_enum = @Type(.{
.Enum = .{
.@"enum" = .{
.tag_type = @Type(.{
.Int = .{ .signedness = .unsigned, .bits = basis_num },
.int = .{ .signedness = .unsigned, .bits = basis_num },
}),
.fields = &enum_fields,
.decls = &.{},
Expand Down Expand Up @@ -346,6 +346,7 @@ pub fn Algebra(comptime T: type, comptime pos_dim: usize, comptime neg_dim: usiz
}{};

pub fn eval(comptime input: []const u8, comptime args: anytype) !Self {
@setEvalBranchQuota(640000);
return try comath.eval(input, geoCtx, args);
}

Expand Down