summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.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-ir-util.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-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 3043e7e31..dd7819e1a 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -21,6 +21,8 @@ IRType* getVectorElementType(IRType* type)
{
if (auto vectorType = as<IRVectorType>(type))
return vectorType->getElementType();
+ if (auto coopVecType = as<IRCoopVectorType>(type))
+ return coopVecType->getElementType();
return type;
}
@@ -1388,6 +1390,7 @@ bool isZero(IRInst* inst)
return as<IRFloatLit>(inst)->getValue() == 0.0;
case kIROp_BoolLit:
return as<IRBoolLit>(inst)->getValue() == false;
+ case kIROp_MakeCoopVector:
case kIROp_MakeVector:
case kIROp_MakeVectorFromScalar:
case kIROp_MakeMatrix:
@@ -1422,6 +1425,7 @@ bool isOne(IRInst* inst)
return as<IRFloatLit>(inst)->getValue() == 1.0;
case kIROp_BoolLit:
return as<IRBoolLit>(inst)->getValue();
+ case kIROp_MakeCoopVector:
case kIROp_MakeVector:
case kIROp_MakeVectorFromScalar:
case kIROp_MakeMatrix: