diff options
| author | Robin Voetter <robin@voetter.nl> | 2021-01-19 00:34:44 +0100 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2021-01-19 15:28:17 +0100 |
| commit | b2b87b590011d8df52874e3f9bd1f88d1b0189d1 (patch) | |
| tree | 3cccc8d6f0424ef50361a9eec66b1ef021e3330d /src/codegen | |
| parent | ab607d455e47c35b980c3281ef5c3fb433a770a7 (diff) | |
| download | zig-b2b87b590011d8df52874e3f9bd1f88d1b0189d1.tar.gz zig-b2b87b590011d8df52874e3f9bd1f88d1b0189d1.zip | |
SPIR-V: Linking and codegen setup
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 { + + } +}; |
