summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-c-like.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-02-25 20:49:31 -0800
committerGitHub <noreply@github.com>2022-02-25 20:49:31 -0800
commitc31577953d5041c82375c22d847c2eba06106c58 (patch)
treebc685a8b63fc13cb85d160ae13df950056ca6e91 /source/slang/slang-emit-c-like.cpp
parent8990d270e3a0c01b1f7abbf4f79556c5ef82a096 (diff)
Improved SCCP, inlining and resource specialization passes, legalize `ImageSubscript` for GLSL (#2146)
Diffstat (limited to 'source/slang/slang-emit-c-like.cpp')
-rw-r--r--source/slang/slang-emit-c-like.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 03943abb3..6b77cba6a 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -893,10 +893,20 @@ void CLikeSourceEmitter::emitSimpleValueImpl(IRInst* inst)
return;
}
case BaseType::UInt8:
+ {
+ m_writer->emit(UInt(uint8_t(litInst->value.intVal)));
+ m_writer->emit("U");
+ break;
+ }
case BaseType::UInt16:
+ {
+ m_writer->emit(UInt(uint16_t(litInst->value.intVal)));
+ m_writer->emit("U");
+ break;
+ }
case BaseType::UInt:
{
- m_writer->emit(UInt(litInst->value.intVal));
+ m_writer->emit(UInt(uint32_t(litInst->value.intVal)));
m_writer->emit("U");
break;
}
@@ -1010,6 +1020,7 @@ bool CLikeSourceEmitter::shouldFoldInstIntoUseSites(IRInst* inst)
//
case kIROp_makeStruct:
case kIROp_makeArray:
+ case kIROp_swizzleSet:
return false;
}