From b3e6f1b2cffa8def593e97a00576eeba0f947ebc Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 25 Mar 2020 16:45:56 -0400 Subject: Unroll target improvements (#1291) * Add unroll support for CUDA, and preliminary for C++. Document [unroll] support. * Fix loop-unroll to run on CPU, and test on CPU and elsewhere. Fix bug in emitting loop unroll condition. * Improved comment. * Added support for vk/glsl loop unrolling. --- source/slang/slang-emit-c-like.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (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 3631040b8..b217a2a1b 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -2592,20 +2592,8 @@ void CLikeSourceEmitter::emitRegion(Region* inRegion) // if (auto loopControlDecoration = loopInst->findDecoration()) { - switch (loopControlDecoration->getMode()) - { - case kIRLoopControl_Unroll: - // Note: loop unrolling control is only available in HLSL, not GLSL - if(getSourceStyle() == SourceStyle::HLSL) - { - m_writer->emit("[unroll]\n"); - } - break; - - default: - break; - } - } + emitLoopControlDecorationImpl(loopControlDecoration); + } m_writer->emit("for(;;)\n{\n"); m_writer->indent(); -- cgit v1.2.3