From 7c8527d20e433c3a10736136d31e4cd882a3baaa Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 4 Oct 2019 09:46:03 -0400 Subject: IR types for subset of Attributes (#1067) * IROutputControlPointsDecoration * IROutputTopologyDecoration * IRPartitioningDecoration * IRDomainDecoration * Use IRPatchConstantDecoration alone for hlsl output. * IRMaxVertexCountDecoration * IRInstanceDecoration * Removed _emitHLSLAttributeSingleString and _emitHLSLAttributeSingleInt Removed GLSLBindingAttribute and just use NumThreadsAttribute * Added IRNumThreadsDecoration. * Added IRNumThreadsDecoration * Fix build problem on x86. Improve diagnostic text based on review. --- source/slang/slang-emit-c-like.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') 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(); + 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; -- cgit v1.2.3