summaryrefslogtreecommitdiff
path: root/source/slang/slang-dxc-support.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-08-19 15:51:43 -0400
committerGitHub <noreply@github.com>2020-08-19 12:51:43 -0700
commitb5a4161a801a573179b1f552e5c53748d2667b03 (patch)
tree4b63bc7274ac060054ab239da4f75aa7233bbddf /source/slang/slang-dxc-support.cpp
parent2fffbc5ff0727482c6ab7d66f6d852701adb277b (diff)
Remove IncludeHandler. (#1505)
nvAPI -> NVAPI nvAPIPath -> nvapiPath DxcIncludeHandler don't reference count. nv-api-path -> nvapi-path Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-dxc-support.cpp')
-rwxr-xr-xsource/slang/slang-dxc-support.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/slang/slang-dxc-support.cpp b/source/slang/slang-dxc-support.cpp
index b0938ed12..9abc4331e 100755
--- a/source/slang/slang-dxc-support.cpp
+++ b/source/slang/slang-dxc-support.cpp
@@ -50,7 +50,7 @@ namespace Slang
static const Guid IID_IDxcIncludeHandler = { 0x7f61fc7d, 0x950d, 0x467f, { 0x3c, 0x02, 0xfb, 0x49, 0x18, 0x7c } };
static const Guid IID_IUnknown = SLANG_UUID_ISlangUnknown;
- class DxcIncludeHandler : public IDxcIncludeHandler, public RefObject
+ class DxcIncludeHandler : public IDxcIncludeHandler
{
public:
// Implement IUnknown
@@ -59,14 +59,13 @@ namespace Slang
ISlangUnknown* intf = getInterface(reinterpret_cast<const Guid&>(uuid));
if (intf)
{
- addReference();
*out = intf;
return SLANG_OK;
}
return SLANG_E_NO_INTERFACE;
}
- SLANG_NO_THROW ULONG SLANG_MCALL AddRef() SLANG_OVERRIDE { return (uint32_t)addReference(); }
- SLANG_NO_THROW ULONG SLANG_MCALL Release() SLANG_OVERRIDE { return (uint32_t)releaseReference(); }
+ SLANG_NO_THROW ULONG SLANG_MCALL AddRef() SLANG_OVERRIDE { return 1; }
+ SLANG_NO_THROW ULONG SLANG_MCALL Release() SLANG_OVERRIDE { return 1; }
// Implement IDxcIncludeHandler
virtual HRESULT SLANG_MCALL LoadSource(LPCWSTR inFilename, IDxcBlob** outSource) SLANG_OVERRIDE
@@ -270,7 +269,7 @@ namespace Slang
const String sourcePath = calcSourcePathForEntryPoint(endToEndReq, entryPointIndex);
- ComPtr<DxcIncludeHandler> includeHandler(new DxcIncludeHandler(&linkage->searchDirectories, linkage->getFileSystemExt()));
+ DxcIncludeHandler includeHandler(&linkage->searchDirectories, linkage->getFileSystemExt(), compileRequest->getSourceManager());
ComPtr<IDxcOperationResult> dxcResult;
SLANG_RETURN_ON_FAIL(dxcCompiler->Compile(dxcSourceBlob,
@@ -279,9 +278,9 @@ namespace Slang
wideProfileName.begin(),
args,
argCount,
- nullptr, // `#define`s
- 0, // `#define` count
- includeHandler, // `#include` handler
+ nullptr, // `#define`s
+ 0, // `#define` count
+ &includeHandler, // `#include` handler
dxcResult.writeRef()));
// Retrieve result.