diff options
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/spirv.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig new file mode 100644 index 0000000000..f0ebd49e1d --- /dev/null +++ b/src/codegen/spirv.zig @@ -0,0 +1,22 @@ +const std = @import("std"); +const spec = @import("spirv/spec.zig"); +const Module = @import("../Module.zig"); +const Decl = Module.Decl; + +pub const SPIRVModule = struct { + // TODO: Also use a free list. + next_id: u32 = 0, + + pub fn allocId(self: *SPIRVModule) u32 { + defer self.next_id += 1; + return self.next_id; + } + + pub fn idBound(self: *SPIRVModule) u32 { + return self.next_id; + } + + pub fn genDecl(self: SPIRVModule, id: u32, code: *std.ArrayList(u32), decl: *Decl) !void { + + } +}; |
