-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scope.java
71 lines (65 loc) · 1.8 KB
/
Scope.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
package com.destranix.glslang;
public enum Scope {
ScopeCrossDevice(Main.SCOPE_CROSS_DEVICE),
ScopeDevice(Main.SCOPE_DEVICE),
ScopeWorkgroup(Main.SCOPE_WORKGROUP),
ScopeSubgroup(Main.SCOPE_SUBGROUP),
ScopeInvocation(Main.SCOPE_INVOCATION),
ScopeQueueFamily(Main.SCOPE_QUEUE_FAMILY),
ScopeQueueFamilyKHR(Main.SCOPE_QUEUE_FAMILY_KHR),
ScopeShaderCallKHR(Main.SCOPE_SHADER_CALL_KHR),
ScopeMax(Main.SCOPE_MAX);
private final int value;
private Scope(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static Scope valueByStr(String str) {
switch (str) {
case "ScopeCrossDevice":
return ScopeCrossDevice;
case "ScopeDevice":
return ScopeDevice;
case "ScopeWorkgroup":
return ScopeWorkgroup;
case "ScopeSubgroup":
return ScopeSubgroup;
case "ScopeInvocation":
return ScopeInvocation;
case "ScopeQueueFamily":
return ScopeQueueFamily;
case "ScopeQueueFamilyKHR":
return ScopeQueueFamilyKHR;
case "ScopeShaderCallKHR":
return ScopeShaderCallKHR;
case "ScopeMax":
return ScopeMax;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static Scope valueByConstant(int constant) {
switch (constant) {
case Main.SCOPE_CROSS_DEVICE:
return ScopeCrossDevice;
case Main.SCOPE_DEVICE:
return ScopeDevice;
case Main.SCOPE_WORKGROUP:
return ScopeWorkgroup;
case Main.SCOPE_SUBGROUP:
return ScopeSubgroup;
case Main.SCOPE_INVOCATION:
return ScopeInvocation;
case Main.SCOPE_QUEUE_FAMILY:
return ScopeQueueFamily;
case Main.SCOPE_SHADER_CALL_KHR:
return ScopeShaderCallKHR;
case Main.SCOPE_MAX:
return ScopeMax;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}