diff options
| author | Anders Leino <aleino@nvidia.com> | 2025-03-06 17:41:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-06 10:41:35 -0500 |
| commit | 55dd2deaff82bbdb72e125ba4b350030b7e5f427 (patch) | |
| tree | 51cca7dbb6644ddf4ba19e179dc9ba4cb0734d81 | |
| parent | 965f96261e2f2674b06be24ad6889c0f022aeff9 (diff) | |
Get options also from the default target (#6530)
This helps to address issue #4760.
The particular issue motivating this fix is that
IGlobalSession::parseCommandLineArguments uses a temporary compile request to parse
options.
The compile request only adds the OptionKind::ForceDXLayout (-fvk-use-dx-layout) to the
"current target" which may be the default target, which
IGlobalSession::parseCommandLineArguments didn't look for, meaning that options like
ForceDXLayout were just ignored.
This leads to test failures in tests that rely on this option, e.g.
tests/spirv/cbuffer-dx-layout-1.slang.
| -rw-r--r-- | source/slang/slang.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 924a4371a..e17d7ba9c 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1111,6 +1111,7 @@ SLANG_NO_THROW SlangResult SLANG_MCALL Session::parseCommandLineArguments( SerializedOptionsData& optionData = outData->options[optionDataIndex]; optionDataIndex++; tempReq->getOptionSet().serialize(&optionData); + tempReq->m_optionSetForDefaultTarget.serialize(&optionData); for (auto target : tempReq->getLinkage()->targets) { slang::TargetDesc tdesc; |
