diff options
Diffstat (limited to 'source/slang/profile.h')
| -rw-r--r-- | source/slang/profile.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/slang/profile.h b/source/slang/profile.h index d6a2a39af..ceccf20a9 100644 --- a/source/slang/profile.h +++ b/source/slang/profile.h @@ -41,6 +41,7 @@ namespace Slang { Unknown = SLANG_STAGE_NONE, #define PROFILE_STAGE(TAG, NAME, VAL) TAG = VAL, +#define PROFILE_STAGE_ALIAS(TAG, NAME, VAL) TAG = VAL, #include "profile-defs.h" }; @@ -53,7 +54,7 @@ namespace Slang { Unknown, -#define PROFILE(TAG, NAME, STAGE, VERSION) TAG = (uint32_t(Stage::STAGE) << 16) | uint32_t(ProfileVersion::VERSION), +#define PROFILE(TAG, NAME, STAGE, VERSION) TAG = (uint32_t(ProfileVersion::VERSION) << 16) | uint32_t(Stage::STAGE), #define PROFILE_ALIAS(TAG, DEF, NAME) TAG = DEF, #include "profile-defs.h" }; @@ -66,16 +67,16 @@ namespace Slang bool operator==(Profile const& other) const { return raw == other.raw; } bool operator!=(Profile const& other) const { return raw != other.raw; } - Stage GetStage() const { return Stage((uint32_t(raw) >> 16) & 0xFFFF); } + Stage GetStage() const { return Stage(uint32_t(raw) & 0xFFFF); } void setStage(Stage stage) { - raw = (raw & 0x0000FFFF) | (uint32_t(stage) << 16); + raw = (raw & ~0xFFFF) | uint32_t(stage); } - ProfileVersion GetVersion() const { return ProfileVersion(uint32_t(raw) & 0xFFFF); } + ProfileVersion GetVersion() const { return ProfileVersion((uint32_t(raw) >> 16) & 0xFFFF); } void setVersion(ProfileVersion version) { - raw = (raw & ~0xFFFF) | uint32_t(version); + raw = (raw & 0x0000FFFF) | (uint32_t(version) << 16); } ProfileFamily getFamily() const { return getProfileFamily(GetVersion()); } |
