diff options
| author | Yong He <yonghe@outlook.com> | 2020-06-05 13:00:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-05 13:00:32 -0700 |
| commit | e3e1cf2045f14837cfecb14e252c0e1083787b93 (patch) | |
| tree | 070f9a3a27796d6edf4f905a3bfbd43a73f06338 /source/slang/slang-emit-hlsl.cpp | |
| parent | 3bb780724830ae830657a47e4eba008a4c0f4ff7 (diff) | |
| parent | 00db8212b3266dfc6f3b1fba2d0f1f0c6fe5ec95 (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.cpp | 9 |
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; } } |
