spirv: emit vectors whenever we can

This commit is contained in:
Ali Chraghi
2024-02-01 19:38:23 +03:30
parent afa7793351
commit b41aad0193
2 changed files with 59 additions and 7 deletions

View File

@@ -508,6 +508,13 @@ pub fn intType(self: *Module, signedness: std.builtin.Signedness, bits: u16) !Ca
} });
}
pub fn vectorType(self: *Module, len: u32, elem_ty_ref: CacheRef) !CacheRef {
return try self.resolve(.{ .vector_type = .{
.component_type = elem_ty_ref,
.component_count = len,
} });
}
pub fn arrayType(self: *Module, len: u32, elem_ty_ref: CacheRef) !CacheRef {
const len_ty_ref = try self.resolve(.{ .int_type = .{
.signedness = .unsigned,