summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-06-15 18:10:02 -0700
committerGitHub <noreply@github.com>2020-06-15 18:10:02 -0700
commit8ec293cfa7c767d652fee683de29629685420f63 (patch)
treea22d5e46ae911b70452565e4b6ad1f2c0c8c65bf /source
parent3461ed41118480c3494f810cddd3cd8c735e2fbb (diff)
parent926e4bb05402eaf4430e52f0fd07c5da79220322 (diff)
Merge pull request #1390 from csyonghe/glsl-loop
Emit [[dont_unroll]] GLSL attribute for [loop] attribute.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-glsl.cpp5
1 files changed, 5 insertions, 0 deletions
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)