yes
All checks were successful
Build / build (push) Successful in 5m39s
Test / build (push) Successful in 11m34s

This commit is contained in:
2026-04-04 03:58:39 +02:00
parent 15eb36ea4d
commit a83a761afa
2 changed files with 28 additions and 16 deletions

View File

@@ -883,14 +883,20 @@ fn ConversionEngine(comptime from_kind: PrimitiveType, comptime to_kind: Primiti
fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp, comptime IsAtomic: bool) type {
return struct {
fn op(_: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeError!void {
fn op(allocator: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeError!void {
const target_type = (try rt.results[try rt.it.next()].getVariant()).Type;
const dst = try rt.results[try rt.it.next()].getValue();
const lhs = try rt.results[try rt.it.next()].getValue();
var arena = std.heap.ArenaAllocator.init(allocator);
defer arena.deinit();
var lhs_save: ?Value = null;
if (comptime IsAtomic) {
_ = rt.it.skip(); // scope
_ = rt.it.skip(); // semantic
lhs_save = try lhs.dupe(arena.allocator());
}
const rhs = try rt.results[try rt.it.next()].getValue();
@@ -989,6 +995,8 @@ fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp, comptime IsAtomic:
if (comptime IsAtomic) {
try copyValue(lhs, dst);
try copyValue(dst, &lhs_save.?);
try lhs.flushPtr(allocator);
}
}