-
Notifications
You must be signed in to change notification settings - Fork 0
/
EShOptimizationLevel.java
48 lines (42 loc) · 1.15 KB
/
EShOptimizationLevel.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
package com.destranix.glslang;
public enum EShOptimizationLevel {
EShOptNoGeneration(Main.E_SH_OPT_NO_GENERATION),
EShOptNone(Main.E_SH_OPT_NONE),
EShOptSimple(Main.E_SH_OPT_SIMPLE),
EShOptFull(Main.E_SH_OPT_FULL);
private final int value;
private EShOptimizationLevel(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static EShOptimizationLevel valueByStr(String str) {
switch (str) {
case "EShOptNoGeneration":
return EShOptNoGeneration;
case "EShOptNone":
return EShOptNone;
case "EShOptSimple":
return EShOptSimple;
case "EShOptFull":
return EShOptFull;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static EShOptimizationLevel valueByConstant(int constant) {
switch (constant) {
case Main.E_SH_OPT_NO_GENERATION:
return EShOptNoGeneration;
case Main.E_SH_OPT_NONE:
return EShOptNone;
case Main.E_SH_OPT_SIMPLE:
return EShOptSimple;
case Main.E_SH_OPT_FULL:
return EShOptFull;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}