summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-type.cpp
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-01-30 00:59:49 -0800
committerGitHub <noreply@github.com>2025-01-30 00:59:49 -0800
commitba9b2785c69c1b8c6d2b4103267b5281815f9f23 (patch)
treee4ba4ca76c6592b90764a0a7ac32502639dc93aa /source/slang/slang-ast-type.cpp
parent2ae194d51e15c064c3d905e628f7335de7504e32 (diff)
Support cooperative vector (#6223)
* Support cooperative vector without Vulkan-header update Adding a Slang support for cooperative vector. But this commit doesn't have Vulkan-header update.
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
-rw-r--r--source/slang/slang-ast-type.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp
index 23d89957a..29a52a93a 100644
--- a/source/slang/slang-ast-type.cpp
+++ b/source/slang/slang-ast-type.cpp
@@ -355,6 +355,29 @@ Type* AtomicType::getElementType()
return as<Type>(_getGenericTypeArg(this, 0));
}
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CoopVectorExpressionType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+Type* CoopVectorExpressionType::getElementType()
+{
+ return as<Type>(_getGenericTypeArg(this, 0));
+}
+
+IntVal* CoopVectorExpressionType::getElementCount()
+{
+ return as<IntVal>(_getGenericTypeArg(this, 1));
+}
+
+void CoopVectorExpressionType::_toTextOverride(StringBuilder& out)
+{
+ out << toSlice("CoopVector<") << getElementType() << toSlice(",") << getElementCount()
+ << toSlice(">");
+}
+
+BasicExpressionType* CoopVectorExpressionType::_getScalarTypeOverride()
+{
+ return as<BasicExpressionType>(getElementType());
+}
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! TypeType !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
void TypeType::_toTextOverride(StringBuilder& out)