Skip to content

Commit 55dd2de

Browse files
authored
Get options also from the default target (shader-slang#6530)
This helps to address issue shader-slang#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.
1 parent 965f962 commit 55dd2de

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/slang/slang.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ SLANG_NO_THROW SlangResult SLANG_MCALL Session::parseCommandLineArguments(
11111111
SerializedOptionsData& optionData = outData->options[optionDataIndex];
11121112
optionDataIndex++;
11131113
tempReq->getOptionSet().serialize(&optionData);
1114+
tempReq->m_optionSetForDefaultTarget.serialize(&optionData);
11141115
for (auto target : tempReq->getLinkage()->targets)
11151116
{
11161117
slang::TargetDesc tdesc;

0 commit comments

Comments
 (0)