SPIR-V: Make emitting binary more efficient
This commit is contained in:
@@ -19,4 +19,10 @@ pub const SPIRVModule = struct {
|
||||
pub fn genDecl(self: SPIRVModule, id: u32, code: *std.ArrayList(u32), decl: *Decl) !void {
|
||||
|
||||
}
|
||||
|
||||
pub fn writeInstruction(code: *std.ArrayList(u32), instr: spec.Opcode, args: []const u32) !void {
|
||||
const word_count = @intCast(u32, args.len + 1);
|
||||
try code.append((word_count << 16) | @enumToInt(instr));
|
||||
try code.appendSlice(args);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user