summaryrefslogtreecommitdiff
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index f28d3cdeb..f440ce3cb 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -546,11 +546,23 @@ SlangResult Session::_readBuiltinModule(ISlangFileSystem* fileSystem, Scope* sco
return SLANG_OK;
}
-ISlangUnknown* Session::getInterface(const Guid& guid)
+SLANG_NO_THROW SlangResult SLANG_MCALL Session::queryInterface(SlangUUID const& uuid, void** outObject)
{
- if(guid == ISlangUnknown::getTypeGuid() || guid == IGlobalSession::getTypeGuid())
- return asExternal(this);
- return nullptr;
+ if (uuid == Session::getTypeGuid())
+ {
+ addReference();
+ *outObject = static_cast<Session*>(this);
+ return SLANG_OK;
+ }
+
+ if (uuid == ISlangUnknown::getTypeGuid() && uuid == IGlobalSession::getTypeGuid())
+ {
+ addReference();
+ *outObject = static_cast<slang::IGlobalSession*>(this);
+ return SLANG_OK;
+ }
+
+ return SLANG_E_NO_INTERFACE;
}
static size_t _getStructureSize(const uint8_t* src)
@@ -4070,6 +4082,11 @@ void Module::buildHash(DigestBuilder<SHA1>& builder)
builder.append(computeDigest());
}
+slang::DeclReflection* Module::getModuleReflection()
+{
+ return (slang::DeclReflection*)m_moduleDecl;
+}
+
SHA1::Digest Module::computeDigest()
{
if (m_digest == SHA1::Digest())