diff options
Diffstat (limited to 'source/compiler-core/slang-artifact-impl.cpp')
| -rw-r--r-- | source/compiler-core/slang-artifact-impl.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/compiler-core/slang-artifact-impl.cpp b/source/compiler-core/slang-artifact-impl.cpp index 056d89a4b..bec28f3eb 100644 --- a/source/compiler-core/slang-artifact-impl.cpp +++ b/source/compiler-core/slang-artifact-impl.cpp @@ -77,10 +77,18 @@ bool Artifact::exists() return false; } -SlangResult Artifact::requireFile(Keep keep, ISlangMutableFileSystem* fileSystem, IFileArtifactRepresentation** outFileRep) +SlangResult Artifact::requireFile(Keep keep, IOSFileArtifactRepresentation** outFileRep) { auto handler = _getHandler(); - return handler->getOrCreateFileRepresentation(this, keep, fileSystem, outFileRep); + + ComPtr<ICastable> castable; + SLANG_RETURN_ON_FAIL(handler->getOrCreateRepresentation(this, IOSFileArtifactRepresentation::getTypeGuid(), keep, castable.writeRef())); + + auto fileRep = as<IOSFileArtifactRepresentation>(castable); + fileRep->addRef(); + + *outFileRep = fileRep; + return SLANG_OK; } SlangResult Artifact::loadSharedLibrary(ArtifactKeep keep, ISlangSharedLibrary** outSharedLibrary) @@ -90,7 +98,7 @@ SlangResult Artifact::loadSharedLibrary(ArtifactKeep keep, ISlangSharedLibrary** ComPtr<ICastable> castable; SLANG_RETURN_ON_FAIL(handler->getOrCreateRepresentation(this, ISlangSharedLibrary::getTypeGuid(), keep, castable.writeRef())); - ISlangSharedLibrary* lib = as<ISlangSharedLibrary>(castable); + auto lib = as<ISlangSharedLibrary>(castable); lib->addRef(); *outSharedLibrary = lib; |
