From 04a81ab634ce058168f7e1554274bbeb34f3a3c5 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 13 Jun 2020 00:24:21 -0700 Subject: Emit [[dont_unroll]] attribute in GLSL --- source/slang/slang-emit-glsl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index a41004622..a73ea529a 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -706,6 +706,11 @@ void GLSLSourceEmitter::emitLoopControlDecorationImpl(IRLoopControlDecoration* d m_glslExtensionTracker->requireExtension(UnownedStringSlice::fromLiteral("GL_EXT_control_flow_attributes")); m_writer->emit("[[unroll]]\n"); } + else if (decl->getMode() == kIRLoopControl_Loop) + { + m_glslExtensionTracker->requireExtension(UnownedStringSlice::fromLiteral("GL_EXT_control_flow_attributes")); + m_writer->emit("[[dont_unroll]]\n"); + } } void GLSLSourceEmitter::emitSimpleValueImpl(IRInst* inst) -- cgit v1.2.3