fixing derivatives agains
This commit is contained in:
+7
-1
@@ -448,7 +448,13 @@ pub fn setDerivativeFromMemory(self: *Self, allocator: std.mem.Allocator, result
|
||||
|
||||
fn getResultTargetTypeWord(self: *const Self, result: SpvWord) RuntimeError!SpvWord {
|
||||
return switch ((try self.results[result].getConstVariant()).*) {
|
||||
.Variable => |v| v.type_word,
|
||||
.Variable => |v| switch ((try self.results[v.type_word].getConstVariant()).*) {
|
||||
.Type => |t| switch (t) {
|
||||
.Pointer => |p| p.target,
|
||||
else => v.type_word,
|
||||
},
|
||||
else => return RuntimeError.InvalidSpirV,
|
||||
},
|
||||
.Constant => |c| c.type_word,
|
||||
.FunctionParameter => |p| p.type_word,
|
||||
.AccessChain => |a| a.target,
|
||||
|
||||
+1
-1
@@ -2885,6 +2885,7 @@ fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp, comptime IsAtomic:
|
||||
.MatrixTimesMatrix,
|
||||
.MatrixTimesScalar,
|
||||
.MatrixTimesVector,
|
||||
.VectorTimesScalar,
|
||||
.VectorTimesMatrix,
|
||||
=> if (comptime is_int) @mulWithOverflow(op1, op2)[0] else op1 * op2,
|
||||
.Div => blk: {
|
||||
@@ -3253,7 +3254,6 @@ fn MathEngine(comptime T: PrimitiveType, comptime Op: MathOp, comptime IsAtomic:
|
||||
|
||||
else => try vectorRoutines(dst, lhs, rhs, lane_bits),
|
||||
}
|
||||
|
||||
if (comptime IsAtomic) {
|
||||
try copyValue(lhs, dst);
|
||||
try copyValue(dst, &lhs_save.?);
|
||||
|
||||
Reference in New Issue
Block a user