diff options
| author | Yong He <yonghe@outlook.com> | 2023-11-20 11:00:39 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-20 11:00:39 -0800 |
| commit | fcc570c9dc27889a5fe10c9df783f9760e126d17 (patch) | |
| tree | 6899e95ec60de27ab8cd793f7fe68a30ceaa2fdd /source | |
| parent | c5a6348326742aa647ae79f95cf543472d827b03 (diff) | |
Allow whole program compile when using direct spirv backend. (#3342)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-options.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 1c1ad8f1c..9830fb18c 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -2945,6 +2945,8 @@ SlangResult OptionsParser::_parse( (m_rawTargets[0].format == CodeGenTarget::HostCPPSource || m_rawTargets[0].format == CodeGenTarget::PyTorchCppBinding || m_rawTargets[0].format == CodeGenTarget::CUDASource || + m_rawTargets[0].format == CodeGenTarget::SPIRV || + m_rawTargets[0].format == CodeGenTarget::SPIRVAssembly || ArtifactDescUtil::makeDescForCompileTarget(asExternal(m_rawTargets[0].format)).kind == ArtifactKind::HostCallable)) { RawOutput rawOutput; @@ -3011,9 +3013,15 @@ SlangResult OptionsParser::_parse( case CodeGenTarget::ShaderSharedLibrary: case CodeGenTarget::PyTorchCppBinding: case CodeGenTarget::DXIL: - rawOutput.isWholeProgram = true; break; + case CodeGenTarget::SPIRV: + case CodeGenTarget::SPIRVAssembly: + if (getCurrentTarget()->targetFlags & SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY) + { + rawOutput.isWholeProgram = true; + } + break; default: m_sink->diagnose(SourceLoc(), Diagnostics::cannotMatchOutputFileToEntryPoint, rawOutput.path); break; |
