summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-c-like.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-c-like.cpp')
-rw-r--r--source/slang/slang-emit-c-like.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index a19823055..281da3ef9 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -203,6 +203,17 @@ void CLikeSourceEmitter::emitSimpleType(IRType* type)
}
}
+
+/* static */IRNumThreadsDecoration* CLikeSourceEmitter::getComputeThreadGroupSize(IRFunc* func, Int outNumThreads[kThreadGroupAxisCount])
+{
+ IRNumThreadsDecoration* decor = func->findDecoration<IRNumThreadsDecoration>();
+ for (int i = 0; i < 3; ++i)
+ {
+ outNumThreads[i] = decor ? Int(GetIntVal(decor->getOperand(i))) : 1;
+ }
+ return decor;
+}
+
void CLikeSourceEmitter::_emitArrayType(IRArrayType* arrayType, EDeclarator* declarator)
{
EDeclarator arrayDeclarator;