diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-08-22 17:39:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-22 14:39:56 -0700 |
| commit | 6ab0baf910dea838dca2d29557c3361297180a34 (patch) | |
| tree | 4f2a3418f0662c8a61fd1ba9bf1c1d24b77c276b /source/compiler-core/slang-downstream-compiler.cpp | |
| parent | 4bd3e6e02324f913e8927fe69d32c0aafe9fc831 (diff) | |
Improve binary compatibility for DownstreamCompiler types (#2371)
* #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
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/compiler-core/slang-downstream-compiler.cpp')
| -rw-r--r-- | source/compiler-core/slang-downstream-compiler.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/compiler-core/slang-downstream-compiler.cpp b/source/compiler-core/slang-downstream-compiler.cpp index 4f7462901..498903727 100644 --- a/source/compiler-core/slang-downstream-compiler.cpp +++ b/source/compiler-core/slang-downstream-compiler.cpp @@ -12,7 +12,7 @@ #include "../core/slang-blob.h" #include "../core/slang-char-util.h" -#include "../core/slang-castable-list-impl.h" +#include "../core/slang-castable-util.h" #include "slang-artifact-associated-impl.h" #include "slang-artifact-util.h" @@ -22,13 +22,12 @@ namespace Slang /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DownstreamCompilerBase !!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ -SlangResult DownstreamCompilerBase::disassemble(SlangCompileTarget sourceBlobTarget, const void* blob, size_t blobSize, ISlangBlob** out) +SlangResult DownstreamCompilerBase::convert(IArtifact* from, const ArtifactDesc& to, IArtifact** outArtifact) { - SLANG_UNUSED(sourceBlobTarget); - SLANG_UNUSED(blob); - SLANG_UNUSED(blobSize); - SLANG_UNUSED(out); - + SLANG_UNUSED(from); + SLANG_UNUSED(to); + SLANG_UNUSED(outArtifact); + return SLANG_E_NOT_AVAILABLE; } @@ -118,7 +117,9 @@ SlangResult CommandLineDownstreamArtifactRepresentation::createRepresentation(co // Read the contents of the binary SLANG_RETURN_ON_FAIL(File::readAllBytes(m_moduleFilePath, contents)); - *outCastable = CastableUtil::getCastable(ScopeRefObjectBlob::create(ListBlob::moveCreate(contents), m_temporaryFiles).detach()).detach(); + auto blob = ScopeRefObjectBlob::create(ListBlob::moveCreate(contents), m_temporaryFiles); + + *outCastable = CastableUtil::getCastable(blob).detach(); return SLANG_OK; } |
