summaryrefslogtreecommitdiff
path: root/source/slang/hlsl.meta.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-12 14:58:00 -0800
committerGitHub <noreply@github.com>2025-02-12 14:58:00 -0800
commit74852ceb6b3bcc018042aba3e30933b7b6fc09ef (patch)
treeb77dd62f0e74510fae0d2af8b7afa260ce9d49b8 /source/slang/hlsl.meta.slang
parent3f102afe1038882f336dc052a9954811150fa700 (diff)
Allow LHS of `where` to be any type. (#6333)
* Allow LHS of `where` to be any type. * Register free-form extensions when loading precompiled module. * Fix test. * Fix. * Fix `as<IRType>`. * try fix precompiled module test.
Diffstat (limited to 'source/slang/hlsl.meta.slang')
-rw-r--r--source/slang/hlsl.meta.slang13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index a10e747c0..81b28b30a 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -524,6 +524,13 @@ interface ITexelElement
__init(Element x);
}
+extension<T:__BuiltinArithmeticType> T : ITexelElement
+{
+ typealias Element = T;
+ static const int elementCount = 1;
+ __intrinsic_op(0) __init(Element x);
+}
+
${{{
// Scalar types that can be used as texel element.
const char* texeElementScalarTypes[] = {
@@ -539,12 +546,6 @@ const char* texeElementScalarTypes[] = {
for (auto elementType : texeElementScalarTypes)
{
}}}
-extension $(elementType) : ITexelElement
-{
- typealias Element = $(elementType);
- static const int elementCount = 1;
- __intrinsic_op(0) __init(Element x);
-}
extension<int N> vector<$(elementType), N> : ITexelElement
{
typealias Element = $(elementType);