working on example and adding opcodes
All checks were successful
Build / build (push) Successful in 2m6s
Test / build (push) Successful in 6m5s

This commit is contained in:
2026-01-23 02:09:30 +01:00
parent bb866f1312
commit 27172539e5
13 changed files with 736 additions and 266 deletions

View File

@@ -1,3 +1,5 @@
//! A runtime meant for actual shader invocations.
const std = @import("std");
const spv = @import("spv.zig");
const op = @import("opcodes.zig");
@@ -127,10 +129,11 @@ pub fn callEntryPoint(self: *Self, allocator: std.mem.Allocator, entry_point_ind
const opcode = (opcode_data & spv.SpvOpCodeMask);
var it_tmp = self.it; // Save because operations may iter on this iterator
if (std.enums.fromInt(spv.SpvOp, opcode)) |spv_op| {
if (op.RuntimeDispatcher.get(spv_op)) |pfn| {
try pfn(allocator, word_count, self);
}
if (op.runtime_dispatcher[opcode]) |pfn| {
pfn(allocator, word_count, self) catch |err| switch (err) {
RuntimeError.Killed => return,
else => return err,
};
}
if (!self.it.did_jump) {
_ = it_tmp.skipN(word_count);