adding branching and conversions
All checks were successful
Build / build (push) Successful in 1m53s
Test / build (push) Successful in 5m16s

This commit is contained in:
2026-01-16 23:41:11 +01:00
parent 5466cbcced
commit 076abf5d6a
11 changed files with 609 additions and 183 deletions

View File

@@ -111,6 +111,7 @@ pub fn callEntryPoint(self: *Self, allocator: std.mem.Allocator, entry_point_ind
}
}
self.it.did_jump = false; // To reset function jump
while (self.it.nextOrNull()) |opcode_data| {
const word_count = ((opcode_data & (~spv.SpvOpCodeMask)) >> spv.SpvWordCountShift) - 1;
const opcode = (opcode_data & spv.SpvOpCodeMask);
@@ -121,8 +122,13 @@ pub fn callEntryPoint(self: *Self, allocator: std.mem.Allocator, entry_point_ind
try pfn(allocator, word_count, self);
}
}
_ = it_tmp.skipN(word_count);
self.it = it_tmp;
if (!self.it.did_jump) {
_ = it_tmp.skipN(word_count);
self.it = it_tmp;
} else {
self.it.did_jump = false;
_ = it_tmp.skip();
}
}
//@import("pretty").print(allocator, self.results, .{