diff options
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 597e27bb9..4904abe03 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -13,6 +13,9 @@ #include "../compiler-core/slang-artifact-desc-util.h" #include "../compiler-core/slang-artifact-util.h" #include "../compiler-core/slang-artifact-associated-impl.h" +#include "../compiler-core/slang-artifact-container-util.h" + +#include "../core/slang-memory-file-system.h" #include "slang-module-library.h" @@ -5234,6 +5237,23 @@ char const* EndToEndCompileRequest::getEntryPointSource(int entryPointIndex) return (char const*)getEntryPointCode(entryPointIndex, nullptr); } +ISlangMutableFileSystem* EndToEndCompileRequest::getCompileRequestResultAsFileSystem() +{ + if (!m_containerFileSystem) + { + if (m_containerArtifact) + { + ComPtr<ISlangMutableFileSystem> fileSystem(new MemoryFileSystem); + if (SLANG_SUCCEEDED(ArtifactContainerUtil::writeContainer(m_containerArtifact, "", fileSystem))) + { + m_containerFileSystem.swap(fileSystem); + } + } + } + + return m_containerFileSystem; +} + void const* EndToEndCompileRequest::getCompileRequestCode(size_t* outSize) { if (m_containerArtifact) |
