summaryrefslogtreecommitdiff
path: root/source/slang/profile.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-15 13:12:51 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-15 13:12:51 -0700
commit517513645afb8eaf4841e7b7035f1ba3a9c7cd57 (patch)
treeeb0fdf58f5f42c427ade3aac136a9053fbf21d54 /source/slang/profile.h
parentc34a433d7aa3fdbfefee22f20d5aac2d960f392a (diff)
Rename `Slang::Compiler` -> `Slang`
This gets rid of one unecessary namespace.
Diffstat (limited to 'source/slang/profile.h')
-rw-r--r--source/slang/profile.h93
1 files changed, 45 insertions, 48 deletions
diff --git a/source/slang/profile.h b/source/slang/profile.h
index 31465c38c..f67207c9e 100644
--- a/source/slang/profile.h
+++ b/source/slang/profile.h
@@ -6,79 +6,76 @@
namespace Slang
{
- namespace Compiler
+ // Flavors of translation unit
+ enum class SourceLanguage : SlangSourceLanguage
{
- // Flavors of translation unit
- enum class SourceLanguage : SlangSourceLanguage
- {
- Unknown = SLANG_SOURCE_LANGUAGE_UNKNOWN, // should not occur
- Slang = SLANG_SOURCE_LANGUAGE_SLANG,
- HLSL = SLANG_SOURCE_LANGUAGE_HLSL,
- GLSL = SLANG_SOURCE_LANGUAGE_GLSL,
+ Unknown = SLANG_SOURCE_LANGUAGE_UNKNOWN, // should not occur
+ Slang = SLANG_SOURCE_LANGUAGE_SLANG,
+ HLSL = SLANG_SOURCE_LANGUAGE_HLSL,
+ GLSL = SLANG_SOURCE_LANGUAGE_GLSL,
- // A separate PACKAGE of Slang code that has been imported
- ImportedSlangCode,
- };
+ // A separate PACKAGE of Slang code that has been imported
+ ImportedSlangCode,
+ };
- // TODO(tfoley): This should merge with the above...
- enum class Language
- {
- Unknown,
+ // TODO(tfoley): This should merge with the above...
+ enum class Language
+ {
+ Unknown,
#define LANGUAGE(TAG, NAME) TAG,
#include "profile-defs.h"
- };
+ };
- enum class ProfileFamily
- {
- Unknown,
+ enum class ProfileFamily
+ {
+ Unknown,
#define PROFILE_FAMILY(TAG) TAG,
#include "profile-defs.h"
- };
+ };
- enum class ProfileVersion
- {
- Unknown,
+ enum class ProfileVersion
+ {
+ Unknown,
#define PROFILE_VERSION(TAG, FAMILY) TAG,
#include "profile-defs.h"
- };
+ };
- enum class Stage : SlangStage
- {
- Unknown = SLANG_STAGE_NONE,
+ enum class Stage : SlangStage
+ {
+ Unknown = SLANG_STAGE_NONE,
#define PROFILE_STAGE(TAG, NAME, VAL) TAG = VAL,
#include "profile-defs.h"
- };
+ };
- ProfileFamily getProfileFamily(ProfileVersion version);
+ ProfileFamily getProfileFamily(ProfileVersion version);
- struct Profile
+ struct Profile
+ {
+ typedef uint32_t RawVal;
+ enum : RawVal
{
- typedef uint32_t RawVal;
- enum : RawVal
- {
- Unknown,
+ Unknown,
#define PROFILE(TAG, NAME, STAGE, VERSION) TAG = (uint32_t(Stage::STAGE) << 16) | uint32_t(ProfileVersion::VERSION),
#include "profile-defs.h"
- };
+ };
- Profile() {}
- Profile(RawVal raw)
- : raw(raw)
- {}
+ Profile() {}
+ Profile(RawVal raw)
+ : raw(raw)
+ {}
- bool operator==(Profile const& other) const { return raw == other.raw; }
- bool operator!=(Profile const& other) const { return raw != other.raw; }
+ 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); }
- ProfileVersion GetVersion() const { return ProfileVersion(uint32_t(raw) & 0xFFFF); }
- ProfileFamily getFamily() const { return getProfileFamily(GetVersion()); }
+ Stage GetStage() const { return Stage((uint32_t(raw) >> 16) & 0xFFFF); }
+ ProfileVersion GetVersion() const { return ProfileVersion(uint32_t(raw) & 0xFFFF); }
+ ProfileFamily getFamily() const { return getProfileFamily(GetVersion()); }
- static Profile LookUp(char const* name);
+ static Profile LookUp(char const* name);
- RawVal raw = Unknown;
- };
- }
+ RawVal raw = Unknown;
+ };
}
#endif