diff options
| author | cheneym2 <acheney@nvidia.com> | 2024-10-04 10:20:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-04 10:20:57 -0400 |
| commit | f521c2002e6b664944c6c39bab767dca1802887a (patch) | |
| tree | 7fb24ff7940a4cdee91f661e607278b4ba530944 /include | |
| parent | 25c17b9fcbf7a21e9fa19c4a8f08b0406437be24 (diff) | |
Add interfaces for retrieving separate linkable downstream binaries (#5128)
* Implement separate downstream library interface
Create a new com interface to house the methods for
precompiling slang modules to target code.
Add methods to count dependent modules and scrape
them for downstream target binaries such that the
downstream target binaries are linkabe outside
of slang, e.g. via spirv-link or dxc.
Fixes #5147
* Rename to _Experimental
Clearly identify this as an interface subject to change.
Diffstat (limited to 'include')
| -rw-r--r-- | include/slang.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/slang.h b/include/slang.h index 81b3ac1cb..6e4ab6250 100644 --- a/include/slang.h +++ b/include/slang.h @@ -5601,13 +5601,34 @@ namespace slang SlangInt32 index) = 0; virtual SLANG_NO_THROW DeclReflection* SLANG_MCALL getModuleReflection() = 0; + }; + + #define SLANG_UUID_IModule IModule::getTypeGuid() + + /* Experimental interface for doing target precompilation of slang modules */ + struct IModulePrecompileService_Experimental : public ISlangUnknown + { + //uuidgen output: 8e12e8e3 - 5fcd - 433e - afcb - 13a088bc5ee5 + SLANG_COM_INTERFACE(0x8e12e8e3, 0x5fcd, 0x433e, { 0xaf, 0xcb, 0x13, 0xa0, 0x88, 0xbc, 0x5e, 0xe5 }) virtual SLANG_NO_THROW SlangResult SLANG_MCALL precompileForTarget( SlangCompileTarget target, ISlangBlob** outDiagnostics) = 0; + + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPrecompiledTargetCode( + SlangCompileTarget target, + IBlob** outCode, + IBlob** outDiagnostics = nullptr) = 0; + + virtual SLANG_NO_THROW SlangInt SLANG_MCALL getModuleDependencyCount() = 0; + + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getModuleDependency( + SlangInt dependencyIndex, + IModule** outModule, + IBlob** outDiagnostics = nullptr) = 0; }; - - #define SLANG_UUID_IModule IModule::getTypeGuid() + + #define SLANG_UUID_IModulePrecompileService_Experimental IModulePrecompileService_Experimental::getTypeGuid() /** Argument used for specialization to types/values. */ |
