diff options
| author | jarcherNV <jarcher@nvidia.com> | 2025-06-06 14:30:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-06 14:30:06 -0700 |
| commit | 0d16228ae22fa2e1a00e62dc099eea08da7717fe (patch) | |
| tree | 067573914132892dc1336dcdea2c8b595f24f871 /include/slang.h | |
| parent | 649d533727b31b28397ffb3a530e655ac3861547 (diff) | |
Add command line option for separate debug info (#7178)
* Add command line option for separate debug info
Add command line arg -separate-debug-info which, if provided, produces
both a .spv and a .dbg.spv file. The .dbg.spv file contains full debug
info and the .spv file has all debug info stripped out.
Also add a DebugBuildIdentifier instruction to store a unique hash in
both the output files, so they can be more easily matched together.
A matching API is provided to allow using the Slang API to retrieve a
base and debug SPIRV as well as the debug build identifier string.
Diffstat (limited to 'include/slang.h')
| -rw-r--r-- | include/slang.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/slang.h b/include/slang.h index 11538bcac..9797ea00c 100644 --- a/include/slang.h +++ b/include/slang.h @@ -1025,6 +1025,7 @@ typedef uint32_t SlangSizeT; SkipDownstreamLinking, // bool, experimental DumpModule, + EmitSeparateDebug, // bool CountOf, }; @@ -4163,9 +4164,32 @@ struct IMetadata : public ISlangCastable SlangUInt spaceIndex, // `space` for D3D12, `set` for Vulkan SlangUInt registerIndex, // `register` for D3D12, `binding` for Vulkan bool& outUsed) = 0; + + /* + Returns the debug build identifier for a base and debug spirv pair. + */ + virtual const char* getDebugBuildIdentifier() = 0; }; #define SLANG_UUID_IMetadata IMetadata::getTypeGuid() +/** Compile result for storing and retrieving multiple output blobs. + This is needed for features such as separate debug compilation which + output both base and debug spirv. + */ +struct ICompileResult : public ISlangCastable +{ + SLANG_COM_INTERFACE( + 0x5fa9380e, + 0xb62f, + 0x41e5, + {0x9f, 0x12, 0x4b, 0xad, 0x4d, 0x9e, 0xaa, 0xe4}) + + virtual uint32_t getItemCount() = 0; + virtual SlangResult getItemData(uint32_t index, IBlob** outblob) = 0; + virtual SlangResult getMetadata(IMetadata** outMetadata) = 0; +}; + #define SLANG_UUID_ICompileResult ICompileResult::getTypeGuid() + /** A component type is a unit of shader code layout, reflection, and linking. A component type is a unit of shader code that can be included into @@ -4384,6 +4408,16 @@ struct IComponentType : public ISlangUnknown SlangInt targetIndex, IMetadata** outMetadata, IBlob** outDiagnostics = nullptr) = 0; + + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTargetCompileResult( + SlangInt targetIndex, + ICompileResult** outCompileResult, + IBlob** outDiagnostics = nullptr) = 0; + virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointCompileResult( + SlangInt entryPointIndex, + SlangInt targetIndex, + ICompileResult** outCompileResult, + IBlob** outDiagnostics = nullptr) = 0; }; #define SLANG_UUID_IComponentType IComponentType::getTypeGuid() |
