From 6cbe215e58eeb8edc53d71e8f315e2fb55c0eeee Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 12 Dec 2023 16:29:51 -0800 Subject: 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 --- source/slang/core.meta.slang | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/slang/core.meta.slang') 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> __subscript(int index) -> vector { __intrinsic_op($(kIROp_GetElement)) get; } } +__intrinsic_op($(kIROp_Eql)) +vector __vectorEql(vector left, vector right); + __generic extension vector : 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); -- cgit v1.2.3