summaryrefslogtreecommitdiff
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 4670af9df..0f5a4b417 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -696,6 +696,7 @@ struct OptionsParser
RawTarget* getCurrentTarget();
void setProfileVersion(RawTarget* rawTarget, ProfileVersion profileVersion);
+ void setProfile(RawTarget* rawTarget, Profile profile);
void addCapabilityAtom(RawTarget* rawTarget, CapabilityName atom);
void setFloatingPointMode(RawTarget* rawTarget, FloatingPointMode mode);
@@ -1056,6 +1057,20 @@ void OptionsParser::setProfileVersion(RawTarget* rawTarget, ProfileVersion profi
rawTarget->optionSet.setProfileVersion(profileVersion);
}
+void OptionsParser::setProfile(RawTarget* rawTarget, Profile profile)
+{
+ if (rawTarget->optionSet.getProfile() != Profile::Unknown)
+ {
+ rawTarget->redundantProfileSet = true;
+
+ if (profile != rawTarget->optionSet.getProfile())
+ {
+ rawTarget->conflictingProfilesSet = true;
+ }
+ }
+ rawTarget->optionSet.setProfile(profile);
+}
+
void OptionsParser::addCapabilityAtom(RawTarget* rawTarget, CapabilityName atom)
{
CapabilitySet capSet(atom);
@@ -1592,10 +1607,8 @@ SlangResult OptionsParser::_parseProfile(const CommandLineArg& arg)
{
auto profile = Profile(profileID);
- setProfileVersion(getCurrentTarget(), profile.getVersion());
+ setProfile(this->getCurrentTarget(), profile);
- // A `-profile` option that also specifies a stage (e.g., `-profile vs_5_0`)
- // should be treated like a composite (e.g., `-profile sm_5_0 -stage vertex`)
auto stage = profile.getStage();
if (stage != Stage::Unknown)
{