-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemoryModel.java
56 lines (50 loc) · 1.48 KB
/
MemoryModel.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
package com.destranix.glslang;
public enum MemoryModel {
MemoryModelSimple(Main.MEMORY_MODEL_SIMPLE),
MemoryModelGLSL450(Main.MEMORY_MODEL_GLSL_450),
MemoryModelOpenCL(Main.MEMORY_MODEL_OPEN_CL),
MemoryModelVulkan(Main.MEMORY_MODEL_VULKAN),
MemoryModelVulkanKHR(Main.MEMORY_MODEL_VULKAN_KHR),
MemoryModelMax(Main.MEMORY_MODEL_MAX);
private final int value;
private MemoryModel(int value) {
this.value = value;
}
public int getConstant() {
return this.value;
}
public static MemoryModel valueByStr(String str) {
switch (str) {
case "MemoryModelSimple":
return MemoryModelSimple;
case "MemoryModelGLSL450":
return MemoryModelGLSL450;
case "MemoryModelOpenCL":
return MemoryModelOpenCL;
case "MemoryModelVulkan":
return MemoryModelVulkan;
case "MemoryModelVulkanKHR":
return MemoryModelVulkanKHR;
case "MemoryModelMax":
return MemoryModelMax;
default:
throw new IllegalArgumentException("Cannot translate string into enum value!");
}
}
public static MemoryModel valueByConstant(int constant) {
switch (constant) {
case Main.MEMORY_MODEL_SIMPLE:
return MemoryModelSimple;
case Main.MEMORY_MODEL_GLSL_450:
return MemoryModelGLSL450;
case Main.MEMORY_MODEL_OPEN_CL:
return MemoryModelOpenCL;
case Main.MEMORY_MODEL_VULKAN:
return MemoryModelVulkan;
case Main.MEMORY_MODEL_MAX:
return MemoryModelMax;
default:
throw new IllegalArgumentException("Cannot translate constant into enum value!");
}
}
}