| ... | ... | @@ -135,10 +135,21 @@ pub fn updateDeclExports( |
| 135 | 135 | decl_index: Module.Decl.Index, |
| 136 | 136 | exports: []const *Module.Export, |
| 137 | 137 | ) !void { |
| 138 | | _ = self; |
| 139 | | _ = module; |
| 140 | | _ = decl_index; |
| 141 | | _ = exports; |
| 138 | const decl = module.declPtr(decl_index); |
| 139 | if (decl.val.tag() == .function and decl.ty.fnCallingConvention() == .Kernel) { |
| 140 | // TODO: Unify with resolveDecl in spirv.zig. |
| 141 | const entry = try self.decl_link.getOrPut(decl_index); |
| 142 | if (!entry.found_existing) { |
| 143 | entry.value_ptr.* = try self.spv.allocDecl(.func); |
| 144 | } |
| 145 | const spv_decl_index = entry.value_ptr.*; |
| 146 | |
| 147 | for (exports) |exp| { |
| 148 | try self.spv.declareEntryPoint(spv_decl_index, exp.options.name); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // TODO: Export regular functions, variables, etc using Linkage attributes. |
| 142 | 153 | } |
| 143 | 154 | |
| 144 | 155 | pub fn freeDecl(self: *SpirV, decl_index: Module.Decl.Index) void { |