From 79e722338cd59aab74b4c57600c5ac6bce3bcd25 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 23 Apr 2021 11:32:07 -0400 Subject: Preliminary CUDA Half support (#1808) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP CUDA half support. * Working support for half on CUDA - requires cuda_fp16.h and associated files can be found. * Fix for win32 for unused funcs. * Fix for Clang. * Hack to disable unused local function warning. --- source/core/slang-shared-library.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/core/slang-shared-library.cpp') diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp index 17b881540..844bea8d9 100644 --- a/source/core/slang-shared-library.cpp +++ b/source/core/slang-shared-library.cpp @@ -76,9 +76,21 @@ TemporarySharedLibrary::~TemporarySharedLibrary() /* !!!!!!!!!!!!!!!!!!!!!!!!!! DefaultSharedLibrary !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ -ISlangUnknown* DefaultSharedLibrary::getInterface(const Guid& guid) +SLANG_NO_THROW SlangResult SLANG_MCALL DefaultSharedLibrary::queryInterface(SlangUUID const& uuid, void** outObject) { - return (guid == ISlangUnknown::getTypeGuid() || guid == ISlangSharedLibrary::getTypeGuid()) ? static_cast(this) : nullptr; + if (uuid == DefaultSharedLibrary::getTypeGuid()) + { + *outObject = this; + return SLANG_OK; + } + + if (uuid == ISlangUnknown::getTypeGuid() || uuid == ISlangSharedLibrary::getTypeGuid()) + { + addReference(); + *outObject = static_cast(this); + return SLANG_OK; + } + return SLANG_E_NO_INTERFACE; } DefaultSharedLibrary::~DefaultSharedLibrary() -- cgit v1.2.3