diff options
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-glsl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp index b1b92e7e7..13eb6e2f6 100644 --- a/source/slang/slang-emit-glsl.cpp +++ b/source/slang/slang-emit-glsl.cpp @@ -1999,6 +1999,22 @@ void GLSLSourceEmitter::emitFuncDecorationImpl(IRDecoration* decoration) m_writer->emit("spirv_instruction(id = "); emitSimpleValue(decoration->getOperand(0)); + + if (decoration->getOperandCount() >= 2) + { + if (auto stringLit = as<IRStringLit>(decoration->getOperand(1))) + { + m_writer->emit(toSlice(", set = ")); + + auto handler = StringEscapeUtil::getHandler(StringEscapeUtil::Style::Cpp); + + StringBuilder buf; + StringEscapeUtil::appendQuoted(handler, stringLit->getStringSlice(), buf); + + m_writer->emitRawTextSpan(buf.begin(), buf.end()); + } + } + m_writer->emit(")\n"); } else |
