]> git.tdb.fi Git - libs/gl.git/blob - source/glsl/spirvconstants.h
Use ObjectInstance instead of AnimatedObject in Scene loader
[libs/gl.git] / source / glsl / spirvconstants.h
1 #ifndef MSP_GL_SL_SPIRVCONSTANTS_H_
2 #define MSP_GL_SL_SPIRVCONSTANTS_H_
3
4 namespace Msp {
5 namespace GL {
6 namespace SL {
7
8 enum SpirVConstants
9 {
10         SPIRV_MAGIC = 0x07230203,
11         SPIRV_MAGIC_REVERSED = 0x03022307
12 };
13
14 enum SpirVOpcode
15 {
16         OP_NOP = 1,
17         OP_NAME = 5,
18         OP_MEMBER_NAME = 6,
19         OP_EXT_INST_IMPORT = 11,
20         OP_EXT_INST = 12,
21         OP_MEMORY_MODEL = 14,
22         OP_ENTRY_POINT = 15,
23         OP_EXECUTION_MODE = 16,
24         OP_CAPABILITY = 17,
25         OP_TYPE_VOID = 19,
26         OP_TYPE_BOOL = 20,
27         OP_TYPE_INT = 21,
28         OP_TYPE_FLOAT = 22,
29         OP_TYPE_VECTOR = 23,
30         OP_TYPE_MATRIX = 24,
31         OP_TYPE_IMAGE = 25,
32         OP_TYPE_SAMPLED_IMAGE = 27,
33         OP_TYPE_ARRAY = 28,
34         OP_TYPE_RUNTIME_ARRAY = 29,
35         OP_TYPE_STRUCT = 30,
36         OP_TYPE_POINTER = 32,
37         OP_TYPE_FUNCTION = 33,
38         OP_CONSTANT_TRUE = 41,
39         OP_CONSTANT_FALSE = 42,
40         OP_CONSTANT = 43,
41         OP_CONSTANT_COMPOSITE = 44,
42         OP_SPEC_CONSTANT_TRUE = 48,
43         OP_SPEC_CONSTANT_FALSE = 49,
44         OP_SPEC_CONSTANT = 50,
45         OP_SPEC_CONSTANT_COMPOSITE = 51,
46         OP_SPEC_CONSTANT_OP = 52,
47         OP_FUNCTION = 54,
48         OP_FUNCTION_PARAMETER = 55,
49         OP_FUNCTION_END = 56,
50         OP_FUNCTION_CALL = 57,
51         OP_VARIABLE = 59,
52         OP_LOAD = 61,
53         OP_STORE = 62,
54         OP_ACCESS_CHAIN = 65,
55         OP_DECORATE = 71,
56         OP_MEMBER_DECORATE = 72,
57         OP_VECTOR_SHUFFLE = 79,
58         OP_COMPOSITE_CONSTRUCT = 80,
59         OP_COMPOSITE_EXTRACT = 81,
60         OP_TRANSPOSE = 84,
61         OP_IMAGE_SAMPLE_IMPLICIT_LOD = 87,
62         OP_IMAGE_SAMPLE_EXPLICIT_LOD = 88,
63         OP_IMAGE_SAMPLE_DREF_IMPLICIT_LOD = 89,
64         OP_IMAGE_SAMPLE_DREF_EXPLICIT_LOD = 89,
65         OP_IMAGE_FETCH = 95,
66         OP_IMAGE_QUERY_SIZE_LOD = 103,
67         OP_CONVERT_F_TO_S = 110,
68         OP_CONVERT_S_TO_F = 111,
69         OP_S_NEGATE = 126,
70         OP_F_NEGATE = 127,
71         OP_I_ADD = 128,
72         OP_F_ADD = 129,
73         OP_I_SUB = 130,
74         OP_F_SUB = 131,
75         OP_I_MUL = 132,
76         OP_F_MUL = 133,
77         OP_S_DIV = 135,
78         OP_F_DIV = 136,
79         OP_S_MOD = 139,
80         OP_F_MOD = 141,
81         OP_VECTOR_TIMES_SCALAR = 142,
82         OP_MATRIX_TIMES_SCALAR = 143,
83         OP_VECTOR_TIMES_MATRIX = 144,
84         OP_MATRIX_TIMES_VECTOR = 145,
85         OP_MATRIX_TIMES_MATRIX = 146,
86         OP_OUTER_PRODUCT = 147,
87         OP_DOT = 148,
88         OP_ANY = 154,
89         OP_ALL = 155,
90         OP_IS_NAN = 156,
91         OP_IS_INF = 157,
92         OP_LOGICAL_EQUAL = 164,
93         OP_LOGICAL_NOT_EQUAL = 165,
94         OP_LOGICAL_OR = 166,
95         OP_LOGICAL_AND = 167,
96         OP_LOGICAL_NOT = 168,
97         OP_SELECT = 169,
98         OP_I_EQUAL = 170,
99         OP_I_NOT_EQUAL = 171,
100         OP_S_GREATER_THAN = 173,
101         OP_S_GREATER_THAN_EQUAL = 175,
102         OP_S_LESS_THAN = 177,
103         OP_S_LESS_THAN_EQUAL = 179,
104         OP_F_ORD_EQUAL = 180,
105         OP_F_ORD_NOT_EQUAL = 182,
106         OP_F_ORD_LESS_THAN = 184,
107         OP_F_ORD_GREATER_THAN = 186,
108         OP_F_ORD_LESS_THAN_EQUAL = 188,
109         OP_F_ORD_GREATER_THAN_EQUAL = 190,
110         OP_SHIFT_RIGHT_ARITHMETIC = 195,
111         OP_SHIFT_LEFT_LOGICAL = 196,
112         OP_BITWISE_OR = 197,
113         OP_BITWISE_XOR = 198,
114         OP_BITWISE_AND = 199,
115         OP_NOT = 200,
116         OP_BIT_FIELD_INSERT = 201,
117         OP_BIT_FIELD_S_EXTRACT = 202,
118         OP_BIT_REVERSE = 204,
119         OP_BIT_COUNT = 205,
120         OP_DP_DX = 207,
121         OP_DP_DY = 208,
122         OP_FWIDTH = 209,
123         OP_DP_DX_FINE = 210,
124         OP_DP_DY_FINE = 211,
125         OP_FWIDTH_FINE = 212,
126         OP_DP_DX_COARSE = 213,
127         OP_DP_DY_COARSE = 214,
128         OP_FWIDTH_COARSE = 215,
129         OP_EMIT_VERTEX = 218,
130         OP_END_PRIMITIVE = 219,
131         OP_PHI = 245,
132         OP_LOOP_MERGE = 246,
133         OP_SELECTION_MERGE = 247,
134         OP_LABEL = 248,
135         OP_BRANCH = 249,
136         OP_BRANCH_CONDITIONAL = 250,
137         OP_KILL = 252,
138         OP_RETURN = 253,
139         OP_RETURN_VALUE = 254,
140         OP_UNREACHABLE = 255
141 };
142
143 enum SpirVCapability
144 {
145         CAP_SHADER = 1,
146         CAP_GEOMETRY = 2,
147         CAP_IMAGE_CUBE_ARRAY = 34,
148         CAP_SAMPLED_1D = 43,
149         CAP_IMAGE_1D = 44,
150         CAP_SAMPLED_CUBE_ARRAY = 45,
151         CAP_INTERPOLATION_FUNCTION = 52
152 };
153
154 enum SpirVExecutionMode
155 {
156         EXEC_ORIGIN_LOWER_LEFT = 8,
157         EXEC_INPUT_POINTS = 19,
158         EXEC_INPUT_LINES = 20,
159         EXEC_INPUT_LINES_ADJACENCY = 21,
160         EXEC_TRIANGLES = 22,
161         EXEC_INPUT_TRIANGLES_ADJACENCY = 23,
162         EXEC_OUTPUT_VERTICES = 26,
163         EXEC_OUTPUT_POINTS = 27,
164         EXEC_OUTPUT_LINE_STRIP = 28,
165         EXEC_OUTPUT_TRIANGLE_STRIP = 29
166 };
167
168 enum SpirVStorageClass
169 {
170         STORAGE_UNIFORM_CONSTANT = 0,
171         STORAGE_INPUT = 1,
172         STORAGE_UNIFORM = 2,
173         STORAGE_OUTPUT = 3,
174         STORAGE_PRIVATE = 6,
175         STORAGE_FUNCTION = 7
176 };
177
178 enum SpirVDecoration
179 {
180         DECO_SPEC_ID = 1,
181         DECO_BLOCK = 2,
182         DECO_ROW_MAJOR = 4,
183         DECO_COL_MAJOR = 5,
184         DECO_ARRAY_STRIDE = 6,
185         DECO_MATRIX_STRIDE = 7,
186         DECO_BUILTIN = 11,
187         DECO_LOCATION = 30,
188         DECO_BINDING = 33,
189         DECO_DESCRIPTOR_SET = 34,
190         DECO_OFFSET = 35
191 };
192
193 enum SpirVBuiltin
194 {
195         BUILTIN_POSITION = 0,
196         BUILTIN_POINT_SIZE = 1,
197         BUILTIN_CLIP_DISTANCE = 3,
198         BUILTIN_VERTEX_ID = 5,
199         BUILTIN_INSTANCE_ID = 6,
200         BUILTIN_PRIMITIVE_ID = 7,
201         BUILTIN_INVOCATION_ID = 8,
202         BUILTIN_LAYER = 9,
203         BUILTIN_FRAG_COORD = 15,
204         BUILTIN_POINT_COORD = 16,
205         BUILTIN_FRONT_FACING = 17,
206         BUILTIN_SAMPLE_ID = 18,
207         BUILTIN_SAMPLE_POSITION = 19,
208         BUILTIN_FRAG_DEPTH = 22
209 };
210
211 enum SpirVGlslStd450Opcode
212 {
213         GLSL450_ROUND = 1,
214         GLSL450_ROUND_EVEN = 2,
215         GLSL450_TRUNC = 3,
216         GLSL450_F_ABS = 4,
217         GLSL450_S_ABS = 5,
218         GLSL450_F_SIGN = 6,
219         GLSL450_S_SIGN = 7,
220         GLSL450_FLOOR = 8,
221         GLSL450_CEIL = 9,
222         GLSL450_FRACT = 10,
223         GLSL450_RADIANS = 11,
224         GLSL450_DEGREES = 12,
225         GLSL450_SIN = 13,
226         GLSL450_COS = 14,
227         GLSL450_TAN = 15,
228         GLSL450_ASIN = 16,
229         GLSL450_ACOS = 17,
230         GLSL450_ATAN = 18,
231         GLSL450_SINH = 19,
232         GLSL450_COSH = 20,
233         GLSL450_TANH = 21,
234         GLSL450_ASINH = 22,
235         GLSL450_ACOSH = 23,
236         GLSL450_ATANH = 24,
237         GLSL450_ATAN2 = 25,
238         GLSL450_POW = 26,
239         GLSL450_EXP = 27,
240         GLSL450_LOG = 28,
241         GLSL450_EXP2 = 29,
242         GLSL450_LOG2 = 30,
243         GLSL450_SQRT = 31,
244         GLSL450_INVERSE_SQRT = 32,
245         GLSL450_DETERMINANT = 33,
246         GLSL450_MATRIX_INVERSE = 33,
247         GLSL450_F_MIN = 37,
248         GLSL450_S_MIN = 39,
249         GLSL450_F_MAX = 40,
250         GLSL450_S_MAX = 42,
251         GLSL450_F_CLAMP = 43,
252         GLSL450_S_CLAMP = 45,
253         GLSL450_F_MIX = 46,
254         GLSL450_F_STEP = 48,
255         GLSL450_F_SMOOTH_STEP = 49,
256         GLSL450_F_FMA = 50,
257         GLSL450_LENGTH = 66,
258         GLSL450_DISTANCE = 67,
259         GLSL450_CROSS = 68,
260         GLSL450_NORMALIZE = 69,
261         GLSL450_FACE_FORWARD = 70,
262         GLSL450_REFLECT = 71,
263         GLSL450_REFRACT = 72,
264         GLSL450_FIND_I_LSB = 73,
265         GLSL450_FIND_S_MSB = 74,
266         GLSL450_INTERPOLATE_AT_CENTROID = 76,
267         GLSL450_INTERPOLATE_AT_SAMPLE = 77,
268         GLSL450_INTERPOLATE_AT_OFFSET = 78
269 };
270
271 } // namespace SL
272 } // namespace GL
273 } // namespace Msp
274
275 #endif