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