spirv: self-referential pointers via new fwd_ptr_type

Its a little ugly but it works.
This commit is contained in:
Robin Voetter
2023-10-21 17:26:59 +02:00
parent 6e955af8c8
commit 6281ad91df
20 changed files with 226 additions and 174 deletions

View File

@@ -507,17 +507,6 @@ pub fn arrayType(self: *Module, len: u32, elem_ty_ref: CacheRef) !CacheRef {
} });
}
pub fn ptrType(
self: *Module,
child: CacheRef,
storage_class: spec.StorageClass,
) !CacheRef {
return try self.resolve(.{ .ptr_type = .{
.storage_class = storage_class,
.child_type = child,
} });
}
pub fn constInt(self: *Module, ty_ref: CacheRef, value: anytype) !IdRef {
const ty = self.cache.lookup(ty_ref).int_type;
const Value = Cache.Key.Int.Value;