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/core/slang-castable-list-impl.h | |
| 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/core/slang-castable-list-impl.h')
| -rw-r--r-- | source/core/slang-castable-list-impl.h | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/source/core/slang-castable-list-impl.h b/source/core/slang-castable-list-impl.h index 2ce124ce7..7a7f98a6a 100644 --- a/source/core/slang-castable-list-impl.h +++ b/source/core/slang-castable-list-impl.h @@ -1,4 +1,4 @@ -// slang-castable-list.h +// slang-castable-list-impl.h #ifndef SLANG_CASTABLE_LIST_IMPL_H #define SLANG_CASTABLE_LIST_IMPL_H @@ -12,42 +12,8 @@ namespace Slang { -/* An adapter such that types which aren't derived from ICastable, can be used as such. - -With the following caveats. -* the interfaces/objects of the adapter are checked *first*, so IUnknown will always be for the adapter -* assumes when doing a queryInterface on the contained item, it will remain in scope when released (this is *not* strict COM) -*/ -class UnknownCastableAdapter : public ComBaseObject, public IUnknownCastableAdapter -{ -public: - SLANG_COM_BASE_IUNKNOWN_ALL - - // ICastable - SLANG_NO_THROW void* SLANG_MCALL castAs(const Guid& guid) SLANG_OVERRIDE; - - // IUnknownCastableAdapter - virtual SLANG_NO_THROW ISlangUnknown* SLANG_MCALL getContained() SLANG_OVERRIDE { return m_contained; } - - UnknownCastableAdapter(ISlangUnknown* unk): - m_contained(unk) - { - SLANG_ASSERT(unk); - } - -protected: - void* getInterface(const Guid& guid); - void* getObject(const Guid& guid); - - ComPtr<ISlangUnknown> m_contained; - - // We hold a cache for a single lookup to make things a little faster - void* m_found = nullptr; - Guid m_foundGuid; -}; - /* Implementation of the ICastableList interface. -Is atomic reference counted*/ +Is atomic reference counted */ class CastableList : public ComBaseObject, public ICastableList { public: @@ -72,17 +38,12 @@ public: /// Dtor virtual ~CastableList(); -protected: void* getInterface(const Guid& guid); void* getObject(const Guid& guid); - List<ICastable*> m_list; -}; +protected: -struct CastableUtil -{ - /// Given an unk return as an unk - static ComPtr<ICastable> getCastable(ISlangUnknown* unk); + List<ICastable*> m_list; }; } // namespace Slang |
