From 55dd2deaff82bbdb72e125ba4b350030b7e5f427 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Thu, 6 Mar 2025 17:41:35 +0200 Subject: 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. --- source/slang/slang.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') 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; -- cgit v1.2.3