summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-05-10 13:05:18 -0400
committerGitHub <noreply@github.com>2022-05-10 13:05:18 -0400
commit8a02d1302264f37394736f953d318b431f64005e (patch)
tree438374f864113ad7b0b65f45ef2f31e621d0f524 /source/slang/slang-emit-glsl.cpp
parent8c540f216f9fe9366bbe57732063607b41344b9f (diff)
Add support for `spirv_literal` (#2227)
* #include an absolute path didn't work - because paths were taken to always be relative. * Add SPIRVLiteralType, to mark types that have spirv_literal in function parameter output. * Update test result. Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index 5b2ae6d19..7578a2dd5 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -1845,10 +1845,15 @@ void GLSLSourceEmitter::emitParamTypeImpl(IRType* type, String const& name)
{
if (auto refType = as<IRRefType>(type))
{
- //
- m_writer->emit("spirv_by_reference ");
+ m_writer->emit("spirv_by_reference ");
type = refType->getValueType();
}
+ else if (auto spirvLiteralType = as<IRSPIRVLiteralType>(type))
+ {
+ m_writer->emit("spirv_literal ");
+ type = spirvLiteralType->getValueType();
+ }
+
Super::emitParamTypeImpl(type, name);
}