summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 40d169c48..10c7bfea6 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -1783,4 +1783,17 @@ void verifyComputeDerivativeGroupModifiers(
}
}
+int getIRVectorElementSize(IRType* type)
+{
+ if (type->getOp() != kIROp_VectorType)
+ return 1;
+ return (int)(as<IRIntLit>(as<IRVectorType>(type)->getElementCount())->value.intVal);
+}
+IRType* getIRVectorBaseType(IRType* type)
+{
+ if (type->getOp() != kIROp_VectorType)
+ return type;
+ return as<IRVectorType>(type)->getElementType();
+}
+
}