aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2021-01-19 00:34:44 +0100
committerRobin Voetter <robin@voetter.nl>2021-01-19 15:28:17 +0100
commitb2b87b590011d8df52874e3f9bd1f88d1b0189d1 (patch)
tree3cccc8d6f0424ef50361a9eec66b1ef021e3330d /src/codegen/spirv.zig
parentab607d455e47c35b980c3281ef5c3fb433a770a7 (diff)
downloadzig-b2b87b590011d8df52874e3f9bd1f88d1b0189d1.tar.gz
zig-b2b87b590011d8df52874e3f9bd1f88d1b0189d1.zip
SPIR-V: Linking and codegen setup
Diffstat (limited to 'src/codegen/spirv.zig')
-rw-r--r--src/codegen/spirv.zig22
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 {
+
+ }
+};