From 4e2f2771eb2f8991014d957848a6a25aa49c0aaf Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Jun 2020 12:42:17 -0700 Subject: Emit [loop] attribute to output HLSL. --- source/slang/slang-emit-hlsl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-emit-hlsl.cpp') diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index 5ebd7e9fc..b15680f29 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -673,9 +673,16 @@ void HLSLSourceEmitter::emitVectorTypeNameImpl(IRType* elementType, IRIntegerVal void HLSLSourceEmitter::emitLoopControlDecorationImpl(IRLoopControlDecoration* decl) { - if (decl->getMode() == kIRLoopControl_Unroll) + switch (decl->getMode()) { + case kIRLoopControl_Unroll: m_writer->emit("[unroll]\n"); + break; + case kIRLoopControl_Loop: + m_writer->emit("[loop]\n"); + break; + default: + SLANG_UNREACHABLE("emit loop control decoration"); } } -- cgit v1.2.3