summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-08-24 09:25:51 -0400
committerGitHub <noreply@github.com>2022-08-24 09:25:51 -0400
commitf5755019246504ad4da4614d1e34a00d74970ea7 (patch)
tree8a0228427bd493681cffa2a94052c61dbc497a5d /source/core
parent6ab0baf910dea838dca2d29557c3361297180a34 (diff)
Assorted Artifact improvements (#2374)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP replacing DownstreamCompileResult. * First attempt at replacing DownstreamCompileResult with IArtifact and associated types. * Small renaming around CharSlice. * ICastable -> ISlangCastable Added IClonable Fix issue with cloning in ArtifactDiagnostics. * Only add the blob if one is defined in DXC. * Guard adding blob representation. * Make cloneInterface available across code base. Set enums backing type for ArtifactDiagnostic. * Added ::create for ArtifactDiagnostics. * Use SemanticVersion for DownstreamCompilerDesc. Set sizes for enum types. * Depreciate old incompatible CompileOptions. Change SemanticVersion use 32 bits for the patch. * Split out CastableUtil. * Change IDownstreamCompiler to use canConvert and convert to use artifact types. * Fix typos. * Fix typo bug. Allow trafficing in PTX assembly/binaries * struct DownstreamCompilerBaseUtil -> struct DownstreamCompilerUtilBase * Add other riff types. * Small fix around artifact kind. * Make using slices instead of strings explicit on atomic ref counted types. (not complete). Added IArtifactList. Use IArtifactList to hold the 'associated' files. Use IUnknown for scoping for atomic ref counting. Small naming improvements. * Make artifact not use String in construction (so it owns contents). * Calculate compile products as artifacts. * Small improvements around ArtifactDesc. * Use ICastableList for list of artifacts and remove IArtifactList.
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-blob.h11
-rw-r--r--source/core/slang-castable-list-impl.h2
-rw-r--r--source/core/slang-shared-library.cpp12
-rw-r--r--source/core/slang-shared-library.h24
4 files changed, 7 insertions, 42 deletions
diff --git a/source/core/slang-blob.h b/source/core/slang-blob.h
index 8a9ab5dea..49bfd4a17 100644
--- a/source/core/slang-blob.h
+++ b/source/core/slang-blob.h
@@ -284,30 +284,29 @@ protected:
size_t m_dataCount;
};
-class ScopeRefObjectBlob : public BlobBase
+class ScopeBlob : public BlobBase
{
public:
// ISlangBlob
SLANG_NO_THROW void const* SLANG_MCALL getBufferPointer() SLANG_OVERRIDE { return m_blob->getBufferPointer(); }
SLANG_NO_THROW size_t SLANG_MCALL getBufferSize() SLANG_OVERRIDE { return m_blob->getBufferSize(); }
- static inline ComPtr<ISlangBlob> create(ISlangBlob* blob, RefObject* scope)
+ static inline ComPtr<ISlangBlob> create(ISlangBlob* blob, ISlangUnknown* scope)
{
- return ComPtr<ISlangBlob>(new ScopeRefObjectBlob(blob, scope));
+ return ComPtr<ISlangBlob>(new ScopeBlob(blob, scope));
}
protected:
// Ctor
- ScopeRefObjectBlob(ISlangBlob* blob, RefObject* scope) :
+ ScopeBlob(ISlangBlob* blob, ISlangUnknown* scope) :
m_blob(blob),
m_scope(scope)
{
}
-
- RefPtr<RefObject> m_scope;
+ ComPtr<ISlangUnknown> m_scope;
ComPtr<ISlangBlob> m_blob;
};
diff --git a/source/core/slang-castable-list-impl.h b/source/core/slang-castable-list-impl.h
index 7a7f98a6a..adbd121fb 100644
--- a/source/core/slang-castable-list-impl.h
+++ b/source/core/slang-castable-list-impl.h
@@ -35,6 +35,8 @@ public:
virtual ICastable* SLANG_MCALL findWithPredicate(FindFunc func, void* data) SLANG_OVERRIDE;
virtual ICastable*const* SLANG_MCALL getBuffer() SLANG_OVERRIDE { return m_list.getBuffer(); }
+ static ComPtr<ICastableList> create() { return ComPtr<ICastableList>(new CastableList); }
+
/// Dtor
virtual ~CastableList();
diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp
index 35440ac9e..e0fe82012 100644
--- a/source/core/slang-shared-library.cpp
+++ b/source/core/slang-shared-library.cpp
@@ -62,18 +62,6 @@ SlangResult DefaultSharedLibraryLoader::loadPlatformSharedLibrary(const char* pa
}
}
-/* !!!!!!!!!!!!!!!!!!!!!!!!!! TemporarySharedLibrary !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
-
-TemporarySharedLibrary::~TemporarySharedLibrary()
-{
- if (m_sharedLibraryHandle)
- {
- // We have to unload if we want to be able to remove
- SharedLibrary::unload(m_sharedLibraryHandle);
- m_sharedLibraryHandle = nullptr;
- }
-}
-
/* !!!!!!!!!!!!!!!!!!!!!!!!!! ScopeSharedLibrary !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
ScopeSharedLibrary::~ScopeSharedLibrary()
diff --git a/source/core/slang-shared-library.h b/source/core/slang-shared-library.h
index 0a63e570e..9015219b1 100644
--- a/source/core/slang-shared-library.h
+++ b/source/core/slang-shared-library.h
@@ -76,30 +76,6 @@ class DefaultSharedLibrary : public ISlangSharedLibrary, public ComBaseObject
SharedLibrary::Handle m_sharedLibraryHandle = nullptr;
};
-class TemporarySharedLibrary : public DefaultSharedLibrary
-{
-public:
- typedef DefaultSharedLibrary Super;
-
- /// Get the path to the shared library
- const String& getPath() const { return m_path; }
-
- /// Ctor
- TemporarySharedLibrary(const SharedLibrary::Handle sharedLibraryHandle, const String& path):
- Super(sharedLibraryHandle),
- m_path(path)
- {
- }
-
- virtual ~TemporarySharedLibrary();
-
- /// Any files specified in this set will be deleted on exit
- RefPtr<TemporaryFileSet> m_temporaryFileSet;
-
-protected:
- String m_path;
-};
-
class ScopeSharedLibrary : public DefaultSharedLibrary
{
public: