-
Notifications
You must be signed in to change notification settings - Fork 0
/
EShMessages.java
118 lines (110 loc) · 3.57 KB
/
EShMessages.java
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package com.destranix.glslang;
import java.util.EnumSet;
public enum EShMessages {
EShMsgDefault(Main.E_SH_MSG_DEFAULT),
EShMsgRelaxedErrors(Main.E_SH_MSG_RELAXED_ERRORS),
EShMsgSuppressWarnings(Main.E_SH_MSG_SUPRESS_WARNINGS),
EShMsgAST(Main.E_SH_MSG_AST),
EShMsgSpvRules(Main.E_SH_MSG_SPV_RULES),
EShMsgVulkanRules(Main.E_SH_MSG_VULKAN_RULES),
EShMsgOnlyPreprocessor(Main.E_SH_MSG_ONLY_PREPROCESSOR),
EShMsgReadHlsl(Main.E_SH_MSG_READ_HLSL),
EShMsgCascadingErrors(Main.E_SH_MSG_CASCADING_ERRORS),
EShMsgKeepUncalled(Main.E_SH_MSG_KEEP_UNCALLED),
EShMsgHlslOffsets(Main.E_SH_MSG_HLSL_OFFSETS),
EShMsgDebugInfo(Main.E_SH_MSG_DEBUG_INFO),
EShMsgHlslEnable16BitTypes(Main.E_SH_MSG_HLSL_ENABLE_16BIT_TYPES),
EShMsgHlslLegalization(Main.E_SH_MSG_HLSL_LEGALIZATION),
EShMsgHlslDX9Compatible(Main.E_SH_MSG_HLSL_DX9_COMPATIBLE),
EShMsgBuiltinSymbolTable(Main.E_SH_MSG_BUITLIN_SYMBOL_TABLE);
private final int value;
private EShMessages(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static int setToInt(EnumSet<EShMessages> set) {
int ret = 0;
for (EShMessages val : set) {
ret |= val.getConstant();
}
return ret;
}
public static EShMessages valueByStr(String str) {
switch (str) {
case "EShMsgDefault":
return EShMsgDefault;
case "EShMsgRelaxedErrors":
return EShMsgRelaxedErrors;
case "EShMsgSuppressWarnings":
return EShMsgSuppressWarnings;
case "EShMsgAST":
return EShMsgAST;
case "EShMsgSpvRules":
return EShMsgSpvRules;
case "EShMsgVulkanRules":
return EShMsgVulkanRules;
case "EShMsgOnlyPreprocessor":
return EShMsgOnlyPreprocessor;
case "EShMsgReadHlsl":
return EShMsgReadHlsl;
case "EShMsgCascadingErrors":
return EShMsgCascadingErrors;
case "EShMsgKeepUncalled":
return EShMsgKeepUncalled;
case "EShMsgHlslOffsets":
return EShMsgHlslOffsets;
case "EShMsgDebugInfo":
return EShMsgDebugInfo;
case "EShMsgHlslEnable16BitTypes":
return EShMsgHlslEnable16BitTypes;
case "EShMsgHlslLegalization":
return EShMsgHlslLegalization;
case "EShMsgHlslDX9Compatible":
return EShMsgHlslDX9Compatible;
case "EShMsgBuiltinSymbolTable":
return EShMsgBuiltinSymbolTable;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static EShMessages valueByConstant(int constant) {
switch (constant) {
case Main.E_SH_MSG_DEFAULT:
return EShMsgDefault;
case Main.E_SH_MSG_RELAXED_ERRORS:
return EShMsgRelaxedErrors;
case Main.E_SH_MSG_SUPRESS_WARNINGS:
return EShMsgSuppressWarnings;
case Main.E_SH_MSG_AST:
return EShMsgAST;
case Main.E_SH_MSG_SPV_RULES:
return EShMsgSpvRules;
case Main.E_SH_MSG_VULKAN_RULES:
return EShMsgVulkanRules;
case Main.E_SH_MSG_ONLY_PREPROCESSOR:
return EShMsgOnlyPreprocessor;
case Main.E_SH_MSG_READ_HLSL:
return EShMsgReadHlsl;
case Main.E_SH_MSG_CASCADING_ERRORS:
return EShMsgCascadingErrors;
case Main.E_SH_MSG_KEEP_UNCALLED:
return EShMsgKeepUncalled;
case Main.E_SH_MSG_HLSL_OFFSETS:
return EShMsgHlslOffsets;
case Main.E_SH_MSG_DEBUG_INFO:
return EShMsgDebugInfo;
case Main.E_SH_MSG_HLSL_ENABLE_16BIT_TYPES:
return EShMsgHlslEnable16BitTypes;
case Main.E_SH_MSG_HLSL_LEGALIZATION:
return EShMsgHlslLegalization;
case Main.E_SH_MSG_HLSL_DX9_COMPATIBLE:
return EShMsgHlslDX9Compatible;
case Main.E_SH_MSG_BUITLIN_SYMBOL_TABLE:
return EShMsgBuiltinSymbolTable;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}