From 4bad669bbc5ec3ff77321f083c59cde87eb10229 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:14:22 -0700 Subject: Replace stdlib on Slang API with CoreModule (#5405) This is a breaking change in a way that the Slang API function names are changed. All of them are commented as "experimental" and we wouldn't provide a back-ward compatibility for them. Following functions are renamed: compileStdLib() -> compileCoreModule() loadStdLib() -> loadCoreModule() saveStdLib() -> saveCoreModule() slang_createGlobalSessionWithoutStdLib() -> slang_createGlobalSessionWithoutCoreModule() slang_getEmbeddedStdLib() -> slang_getEmbeddedCoreModule() hasDeferredStdLib() -> hasDeferredCoreModule() Following command-line arguments are renamed: "-load-stdlib" -> "-load-core-module" "-save-stdlib" -> "-save-core-module" "-save-stdlib-bin-source" -> "-save-core-module-bin-source" "-compile-stdlib" -> "-compile-core-module" --- source/slang/slang.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 93fb2c203..b77a3efc8 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -342,7 +342,7 @@ void Session::writeStdlibDoc(String config) } } -SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags) +SlangResult Session::compileCoreModule(slang::CompileCoreModuleFlags compileFlags) { SLANG_AST_BUILDER_RAII(m_builtinLinkage->getASTBuilder()); @@ -369,7 +369,7 @@ SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags) auto stdLibSrcBlob = StringBlob::moveCreate(stdLibSrcBuilder.produceString()); addBuiltinSource(coreLanguageScope, "core", stdLibSrcBlob); - if (compileFlags & slang::CompileStdLibFlag::WriteDocumentation) + if (compileFlags & slang::CompileCoreModuleFlag::WriteDocumentation) { // Load config file first. String configText; @@ -393,7 +393,7 @@ SlangResult Session::compileStdLib(slang::CompileStdLibFlags compileFlags) return SLANG_OK; } -SlangResult Session::loadStdLib(const void* stdLib, size_t stdLibSizeInBytes) +SlangResult Session::loadCoreModule(const void* coreModule, size_t coreModuleSizeInBytes) { SLANG_PROFILE; @@ -407,7 +407,7 @@ SlangResult Session::loadStdLib(const void* stdLib, size_t stdLibSizeInBytes) // Make a file system to read it from ComPtr fileSystem; - SLANG_RETURN_ON_FAIL(loadArchiveFileSystem(stdLib, stdLibSizeInBytes, fileSystem)); + SLANG_RETURN_ON_FAIL(loadArchiveFileSystem(coreModule, coreModuleSizeInBytes, fileSystem)); // Let's try loading serialized modules and adding them SLANG_RETURN_ON_FAIL(_readBuiltinModule(fileSystem, coreLanguageScope, "core")); @@ -416,7 +416,7 @@ SlangResult Session::loadStdLib(const void* stdLib, size_t stdLibSizeInBytes) return SLANG_OK; } -SlangResult Session::saveStdLib(SlangArchiveType archiveType, ISlangBlob** outBlob) +SlangResult Session::saveCoreModule(SlangArchiveType archiveType, ISlangBlob** outBlob) { if (m_builtinLinkage->mapNameToLoadedModules.getCount() == 0) { -- cgit v1.2.3