summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-05-18 10:09:28 -0400
committerGitHub <noreply@github.com>2022-05-18 10:09:28 -0400
commit1148564b9cdbbc8fec4fbecf65b0af60aa6af344 (patch)
treefc5ca7629aed7e60797163c33deb56a4137249b4 /source/slang/slang-emit-glsl.cpp
parentd9fd0ff3f0fc7b775de1e05570f01798fbc8baa3 (diff)
Support for `[[vk::spirv_instruction(op)]]` (#2242)
* #include an absolute path didn't work - because paths were taken to always be relative. * Add extension required by SPIRVOpDecoration into part of emit (could be a prior pass). * Add [[vk::spirv_instruction]] attribute * Add documentation for [[vk::spirv_instruction]. * Update 08-attributes.md * Update 08-attributes.md
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index d9c81f14b..c1bbf813b 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -1881,6 +1881,8 @@ void GLSLSourceEmitter::emitFuncDecorationImpl(IRDecoration* decoration)
{
if (decoration->getOp() == kIROp_SPIRVOpDecoration)
{
+ m_glslExtensionTracker->requireExtension(UnownedStringSlice::fromLiteral("GL_EXT_spirv_intrinsics"));
+
m_writer->emit("spirv_instruction(id = ");
emitSimpleValue(decoration->getOperand(0));
m_writer->emit(")\n");