summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-c-like.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-06-22 15:07:31 -0400
committerGitHub <noreply@github.com>2023-06-22 15:07:31 -0400
commit769c7fdd19ea579770baac7b6d5e16d6406a8013 (patch)
treea0f04c668911a2b3b58e0fc89f5bb765540226bd /source/slang/slang-emit-c-like.cpp
parentac541d45fafde340b141172cf76d003ff70d471e (diff)
[branch] and [flatten] support (#2928)
* #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Add HLSL output support for [flatten] and [branch] * Handle [branch] on switch.
Diffstat (limited to 'source/slang/slang-emit-c-like.cpp')
-rw-r--r--source/slang/slang-emit-c-like.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index c7ea3a09a..872a7a8b2 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -2792,6 +2792,8 @@ void CLikeSourceEmitter::emitRegion(Region* inRegion)
{
auto ifRegion = (IfRegion*) region;
+ emitIfDecorationsImpl(ifRegion->ifElseInst);
+
// TODO: consider simplifying the code in
// the case where `ifRegion == null`
// so that we output `if(!condition) { elseRegion }`
@@ -2858,6 +2860,8 @@ void CLikeSourceEmitter::emitRegion(Region* inRegion)
{
auto switchRegion = (SwitchRegion*) region;
+ emitSwitchDecorationsImpl(switchRegion->switchInst);
+
// Emit the start of our statement.
m_writer->emit("switch(");
emitOperand(switchRegion->getCondition(), getInfo(EmitOp::General));