summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-profile.cpp
blob: e5ce6fde3f7159938de22e31343f71c074bf4270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// slang-profile.cpp
#include "slang-profile.h"

namespace Slang {

ProfileFamily getProfileFamily(ProfileVersion version)
{
    switch( version )
    {
    default: return ProfileFamily::Unknown;

#define PROFILE_VERSION(TAG, FAMILY) case ProfileVersion::TAG: return ProfileFamily::FAMILY;
#include "slang-profile-defs.h"
    }
}

const char* getStageName(Stage stage)
{
    switch(stage)
    {
#define PROFILE_STAGE(ID, NAME, ENUM) \
    case Stage::ID: return #NAME;

#include "slang-profile-defs.h"

    default:
        return nullptr;
    }

}

void printDiagnosticArg(StringBuilder& sb, Stage val)
{
    sb << getStageName(val);
}

void printDiagnosticArg(StringBuilder& sb, ProfileVersion val)
{
    sb << Profile(val).getName();
}


}