summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-hlsl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-06-05 13:00:32 -0700
committerGitHub <noreply@github.com>2020-06-05 13:00:32 -0700
commite3e1cf2045f14837cfecb14e252c0e1083787b93 (patch)
tree070f9a3a27796d6edf4f905a3bfbd43a73f06338 /source/slang/slang-emit-hlsl.cpp
parent3bb780724830ae830657a47e4eba008a4c0f4ff7 (diff)
parent00db8212b3266dfc6f3b1fba2d0f1f0c6fe5ec95 (diff)
Merge pull request #1371 from csyonghe/loop_attrib
Emit [loop] attribute to output HLSL.
Diffstat (limited to 'source/slang/slang-emit-hlsl.cpp')
-rw-r--r--source/slang/slang-emit-hlsl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp
index 5ebd7e9fc..83bfb8f2a 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:
+ break;
}
}