summaryrefslogtreecommitdiff
path: root/source/slang/core.meta.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-12 16:29:51 -0800
committerGitHub <noreply@github.com>2023-12-12 16:29:51 -0800
commit6cbe215e58eeb8edc53d71e8f315e2fb55c0eeee (patch)
treece82de695b51ba7882253dec74fc675dcaf07a9e /source/slang/core.meta.slang
parent92f21de580e16a37600f082c0968913111f5ef91 (diff)
Define `Texture::Sample` for float element types only. (#3403)
* Define `Texture::Sample` for float element types only. * Fixes #490. * Fix checking of groupshared. * Add test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/core.meta.slang')
-rw-r--r--source/slang/core.meta.slang9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang
index 3a19d345a..fbb18109e 100644
--- a/source/slang/core.meta.slang
+++ b/source/slang/core.meta.slang
@@ -1091,12 +1091,15 @@ struct matrix : IArray<vector<T,C>>
__subscript(int index) -> vector<T,C> { __intrinsic_op($(kIROp_GetElement)) get; }
}
+__intrinsic_op($(kIROp_Eql))
+vector<bool, N> __vectorEql<T, let N:int>(vector<T, N> left, vector<T,N> right);
+
__generic<T:__BuiltinFloatingPointType, let N : int>
extension vector<T,N> : IFloat
{
- [__unsafeForceInlineEarly] bool lessThan(This other) { return this < other; }
- [__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this <= other; }
- [__unsafeForceInlineEarly] bool equals(This other) { return all(this == other); }
+ [__unsafeForceInlineEarly] bool lessThan(This other) { return this[0] < other[0]; }
+ [__unsafeForceInlineEarly] bool lessThanOrEquals(This other) { return this[0] <= other[0]; }
+ [__unsafeForceInlineEarly] bool equals(This other) { return all(__vectorEql(this, other)); }
__intrinsic_op($(kIROp_Add)) This add(This other);
__intrinsic_op($(kIROp_Sub)) This sub(This other);
__intrinsic_op($(kIROp_Mul)) This mul(This other);