summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/diff.meta.slang4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/diff.meta.slang b/source/slang/diff.meta.slang
index 8a46f7d60..5817ac7cf 100644
--- a/source/slang/diff.meta.slang
+++ b/source/slang/diff.meta.slang
@@ -1548,7 +1548,7 @@ DifferentialPair<T> __d_clamp(DifferentialPair<T> dpx, DifferentialPair<T> dpMin
{
return DifferentialPair<T>(
clamp(dpx.p, dpMin.p, dpMax.p),
- dpx.p < dpMin.p ? (dpx.p > dpMax.p ? dpMax.d : dpx.d) : dpMin.d);
+ dpx.p < dpMin.p ? dpMin.d : (dpx.p > dpMax.p ? dpMax.d : dpx.d));
}
__generic<T : __BuiltinFloatingPointType>
[BackwardDifferentiable]
@@ -1558,7 +1558,7 @@ void __d_clamp(inout DifferentialPair<T> dpx, inout DifferentialPair<T> dpMin, i
{
dpx = diffPair(dpx.p, dpx.p > dpMin.p && dpx.p < dpMax.p ? dOut : T.dzero());
dpMin = diffPair(dpMin.p, dpx.p <= dpMin.p ? dOut : T.dzero());
- dpMax = diffPair(dpMin.p, dpx.p >= dpMax.p ? dOut : T.dzero());
+ dpMax = diffPair(dpMax.p, dpx.p >= dpMax.p ? dOut : T.dzero());
}
VECTOR_MATRIX_TERNARY_DIFF_IMPL(clamp)