summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-07-14 16:31:12 -0400
committerGitHub <noreply@github.com>2023-07-14 16:31:12 -0400
commit2de296ca00c0e77526ae1a83b4fb3df30419f70b (patch)
tree1aeac2f3d07890532ac0d359ca6bf2d1d010dbd8 /source/slang/slang-options.cpp
parent68f80f0793cff96b1fc784059a76605888593cd8 (diff)
Allow setting of HLSLToVulkan options without having a target specified on the command line options. (#2989)
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index ad061a4e5..552d5bc47 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -2351,12 +2351,16 @@ SlangResult OptionsParser::_parse(
}
}
- // If there are no layout settings, we don't need to carry this state
- if (m_hlslToVulkanLayoutOptions->isReset())
+ // If there is state set on HLSL to Vulkan layout settings, set on the end to end request
+ // such can be added when target requests are setup
+ if (!m_hlslToVulkanLayoutOptions->isReset())
{
- m_hlslToVulkanLayoutOptions.setNull();
+ m_requestImpl->setHLSLToVulkanLayoutOptions(m_hlslToVulkanLayoutOptions);
}
+ // No longer need to track
+ m_hlslToVulkanLayoutOptions.setNull();
+
if (m_compileStdLib)
{
SLANG_RETURN_ON_FAIL(m_session->compileStdLib(m_compileStdLibFlags));
@@ -2762,8 +2766,6 @@ SlangResult OptionsParser::_parse(
int targetID = m_compileRequest->addCodeGenTarget(SlangCompileTarget(rawTarget.format));
rawTarget.targetID = targetID;
- m_requestImpl->setHLSLToVulkanLayoutOptions(targetID, m_hlslToVulkanLayoutOptions);
-
if (rawTarget.profileVersion != ProfileVersion::Unknown)
{
m_compileRequest->setTargetProfile(targetID, SlangProfileID(Profile(rawTarget.profileVersion).raw));