fixes
All checks were successful
Build / build (push) Successful in 2m3s
Test / build (push) Successful in 8m21s

This commit is contained in:
2026-03-22 04:47:59 +01:00
parent cb0cdaab36
commit 2d0d3b40fd
2 changed files with 160 additions and 87 deletions

View File

@@ -461,6 +461,41 @@ pub const Value = union(Type) {
};
}
pub inline fn getLaneCount(self: *const Self) RuntimeError!usize {
return switch (self.*) {
.Vector => |lanes| lanes.len,
.Vector2i32, .Vector2u32, .Vector2f32 => 2,
.Vector3i32, .Vector3u32, .Vector3f32 => 3,
.Vector4i32, .Vector4u32, .Vector4f32 => 4,
.Int, .Float, .Bool => 1,
else => RuntimeError.InvalidSpirV,
};
}
pub inline fn isScalar(self: *const Self) bool {
return switch (self.*) {
.Bool, .Int, .Float => true,
else => false,
};
}
pub inline fn isVector(self: *const Self) bool {
return switch (self.*) {
.Vector,
.Vector2i32,
.Vector2u32,
.Vector2f32,
.Vector3i32,
.Vector3u32,
.Vector3f32,
.Vector4i32,
.Vector4u32,
.Vector4f32,
=> true,
else => false,
};
}
pub fn flushPtr(self: *Self, allocator: std.mem.Allocator) RuntimeError!void {
switch (self.*) {
.Pointer => |*p| {