Skip to content

Commit c29241d

Browse files
committed
Fix.
1 parent c6c3c12 commit c29241d

File tree

3 files changed

+36
-26504
lines changed

3 files changed

+36
-26504
lines changed

source/slang/core.meta.slang

+30-4
Original file line numberDiff line numberDiff line change
@@ -1903,8 +1903,22 @@ vector<bool, N> __vectorEql<T, let N : int>(vector<T, N> left, vector<T, N> righ
19031903
__generic<T:__BuiltinIntegerType, let N : int>
19041904
extension vector<T,N> : IInteger
19051905
{
1906-
[__unsafeForceInlineEarly] bool lessThan(This other) { return this[0] < other[0]; }
1907-
[__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this[0] <= other[0]; }
1906+
[__unsafeForceInlineEarly] bool lessThan(This other)
1907+
{
1908+
[ForceUnroll]
1909+
for (int i = 0; i < N; i++)
1910+
if (this[i] < other[i])
1911+
return true;
1912+
return false;
1913+
}
1914+
[__unsafeForceInlineEarly] bool lessThanOrEquals(This other)
1915+
{
1916+
[ForceUnroll]
1917+
for (int i = 0; i < N; i++)
1918+
if (this[i] <= other[i])
1919+
return true;
1920+
return false;
1921+
}
19081922
[__unsafeForceInlineEarly] bool equals(This other) { return all(__vectorEql(this, other)); }
19091923
__intrinsic_op($(kIROp_Add)) This add(This other);
19101924
__intrinsic_op($(kIROp_Sub)) This sub(This other);
@@ -2032,8 +2046,20 @@ extension vector<T,N> : IDifferentiable
20322046
__generic<T:__BuiltinFloatingPointType, let N : int, let M : int, let L : int>
20332047
extension matrix<T,N,M,L> : IFloat
20342048
{
2035-
[TreatAsDifferentiable][__unsafeForceInlineEarly] bool lessThan(This other) { return this < other; }
2036-
[TreatAsDifferentiable][__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this <= other; }
2049+
[TreatAsDifferentiable] [__unsafeForceInlineEarly] bool lessThan(This other)
2050+
{
2051+
[ForceUnroll]
2052+
for (int i = 0; i < N; i++)
2053+
if (this[i].lessThan(other[i])) return true;
2054+
return false;
2055+
}
2056+
[TreatAsDifferentiable] [__unsafeForceInlineEarly] bool lessThanOrEquals(This other)
2057+
{
2058+
[ForceUnroll]
2059+
for (int i = 0; i < N; i++)
2060+
if (this[i].lessThanOrEquals(other[i])) return true;
2061+
return false;
2062+
}
20372063
[TreatAsDifferentiable][__unsafeForceInlineEarly] bool equals(This other) { return all(this == other); }
20382064
[TreatAsDifferentiable] __intrinsic_op($(kIROp_Add)) This add(This other);
20392065
[TreatAsDifferentiable] __intrinsic_op($(kIROp_Sub)) This sub(This other);

0 commit comments

Comments
 (0)