• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // PackedGLEnums_autogen.h:
9 //   Declares ANGLE-specific enums classes for GLenums and functions operating
10 //   on them.
11 
12 #ifndef COMMON_PACKEDGLENUMS_AUTOGEN_H_
13 #define COMMON_PACKEDGLENUMS_AUTOGEN_H_
14 
15 #include <EGL/egl.h>
16 #include <EGL/eglext.h>
17 #include <angle_gl.h>
18 
19 #include <cstdint>
20 #include <ostream>
21 
22 namespace gl
23 {
24 
25 template <typename Enum>
26 Enum FromGLenum(GLenum from);
27 
28 enum class AlphaTestFunc : uint8_t
29 {
30     AlwaysPass = 0,
31     Equal      = 1,
32     Gequal     = 2,
33     Greater    = 3,
34     Lequal     = 4,
35     Less       = 5,
36     Never      = 6,
37     NotEqual   = 7,
38 
39     InvalidEnum = 8,
40     EnumCount   = 8,
41 };
42 
43 template <>
44 AlphaTestFunc FromGLenum<AlphaTestFunc>(GLenum from);
45 GLenum ToGLenum(AlphaTestFunc from);
46 std::ostream &operator<<(std::ostream &os, AlphaTestFunc value);
47 
48 enum class BufferBinding : uint8_t
49 {
50     Array             = 0,
51     AtomicCounter     = 1,
52     CopyRead          = 2,
53     CopyWrite         = 3,
54     DispatchIndirect  = 4,
55     DrawIndirect      = 5,
56     ElementArray      = 6,
57     PixelPack         = 7,
58     PixelUnpack       = 8,
59     ShaderStorage     = 9,
60     TransformFeedback = 10,
61     Uniform           = 11,
62 
63     InvalidEnum = 12,
64     EnumCount   = 12,
65 };
66 
67 template <>
68 BufferBinding FromGLenum<BufferBinding>(GLenum from);
69 GLenum ToGLenum(BufferBinding from);
70 std::ostream &operator<<(std::ostream &os, BufferBinding value);
71 
72 enum class BufferUsage : uint8_t
73 {
74     DynamicCopy = 0,
75     DynamicDraw = 1,
76     DynamicRead = 2,
77     StaticCopy  = 3,
78     StaticDraw  = 4,
79     StaticRead  = 5,
80     StreamCopy  = 6,
81     StreamDraw  = 7,
82     StreamRead  = 8,
83 
84     InvalidEnum = 9,
85     EnumCount   = 9,
86 };
87 
88 template <>
89 BufferUsage FromGLenum<BufferUsage>(GLenum from);
90 GLenum ToGLenum(BufferUsage from);
91 std::ostream &operator<<(std::ostream &os, BufferUsage value);
92 
93 enum class ClientVertexArrayType : uint8_t
94 {
95     Color        = 0,
96     Normal       = 1,
97     PointSize    = 2,
98     TextureCoord = 3,
99     Vertex       = 4,
100 
101     InvalidEnum = 5,
102     EnumCount   = 5,
103 };
104 
105 template <>
106 ClientVertexArrayType FromGLenum<ClientVertexArrayType>(GLenum from);
107 GLenum ToGLenum(ClientVertexArrayType from);
108 std::ostream &operator<<(std::ostream &os, ClientVertexArrayType value);
109 
110 enum class CullFaceMode : uint8_t
111 {
112     Back         = 0,
113     Front        = 1,
114     FrontAndBack = 2,
115 
116     InvalidEnum = 3,
117     EnumCount   = 3,
118 };
119 
120 template <>
121 CullFaceMode FromGLenum<CullFaceMode>(GLenum from);
122 GLenum ToGLenum(CullFaceMode from);
123 std::ostream &operator<<(std::ostream &os, CullFaceMode value);
124 
125 enum class FilterMode : uint8_t
126 {
127     Nearest              = 0,
128     Linear               = 1,
129     NearestMipmapNearest = 2,
130     NearestMipmapLinear  = 3,
131     LinearMipmapLinear   = 4,
132 
133     InvalidEnum = 5,
134     EnumCount   = 5,
135 };
136 
137 template <>
138 FilterMode FromGLenum<FilterMode>(GLenum from);
139 GLenum ToGLenum(FilterMode from);
140 std::ostream &operator<<(std::ostream &os, FilterMode value);
141 
142 enum class FogMode : uint8_t
143 {
144     Exp    = 0,
145     Exp2   = 1,
146     Linear = 2,
147 
148     InvalidEnum = 3,
149     EnumCount   = 3,
150 };
151 
152 template <>
153 FogMode FromGLenum<FogMode>(GLenum from);
154 GLenum ToGLenum(FogMode from);
155 std::ostream &operator<<(std::ostream &os, FogMode value);
156 
157 enum class GraphicsResetStatus : uint8_t
158 {
159     NoError              = 0,
160     GuiltyContextReset   = 1,
161     InnocentContextReset = 2,
162     UnknownContextReset  = 3,
163 
164     InvalidEnum = 4,
165     EnumCount   = 4,
166 };
167 
168 template <>
169 GraphicsResetStatus FromGLenum<GraphicsResetStatus>(GLenum from);
170 GLenum ToGLenum(GraphicsResetStatus from);
171 std::ostream &operator<<(std::ostream &os, GraphicsResetStatus value);
172 
173 enum class HandleType : uint8_t
174 {
175     OpaqueFd    = 0,
176     ZirconVmo   = 1,
177     ZirconEvent = 2,
178 
179     InvalidEnum = 3,
180     EnumCount   = 3,
181 };
182 
183 template <>
184 HandleType FromGLenum<HandleType>(GLenum from);
185 GLenum ToGLenum(HandleType from);
186 std::ostream &operator<<(std::ostream &os, HandleType value);
187 
188 enum class HintSetting : uint8_t
189 {
190     DontCare = 0,
191     Fastest  = 1,
192     Nicest   = 2,
193 
194     InvalidEnum = 3,
195     EnumCount   = 3,
196 };
197 
198 template <>
199 HintSetting FromGLenum<HintSetting>(GLenum from);
200 GLenum ToGLenum(HintSetting from);
201 std::ostream &operator<<(std::ostream &os, HintSetting value);
202 
203 enum class ImageLayout : uint8_t
204 {
205     Undefined                      = 0,
206     General                        = 1,
207     ColorAttachment                = 2,
208     DepthStencilAttachment         = 3,
209     DepthStencilReadOnlyAttachment = 4,
210     ShaderReadOnly                 = 5,
211     TransferSrc                    = 6,
212     TransferDst                    = 7,
213     DepthReadOnlyStencilAttachment = 8,
214     DepthAttachmentStencilReadOnly = 9,
215 
216     InvalidEnum = 10,
217     EnumCount   = 10,
218 };
219 
220 template <>
221 ImageLayout FromGLenum<ImageLayout>(GLenum from);
222 GLenum ToGLenum(ImageLayout from);
223 std::ostream &operator<<(std::ostream &os, ImageLayout value);
224 
225 enum class LightParameter : uint8_t
226 {
227     Ambient              = 0,
228     AmbientAndDiffuse    = 1,
229     ConstantAttenuation  = 2,
230     Diffuse              = 3,
231     LinearAttenuation    = 4,
232     Position             = 5,
233     QuadraticAttenuation = 6,
234     Specular             = 7,
235     SpotCutoff           = 8,
236     SpotDirection        = 9,
237     SpotExponent         = 10,
238 
239     InvalidEnum = 11,
240     EnumCount   = 11,
241 };
242 
243 template <>
244 LightParameter FromGLenum<LightParameter>(GLenum from);
245 GLenum ToGLenum(LightParameter from);
246 std::ostream &operator<<(std::ostream &os, LightParameter value);
247 
248 enum class LogicalOperation : uint8_t
249 {
250     And          = 0,
251     AndInverted  = 1,
252     AndReverse   = 2,
253     Clear        = 3,
254     Copy         = 4,
255     CopyInverted = 5,
256     Equiv        = 6,
257     Invert       = 7,
258     Nand         = 8,
259     Noop         = 9,
260     Nor          = 10,
261     Or           = 11,
262     OrInverted   = 12,
263     OrReverse    = 13,
264     Set          = 14,
265     Xor          = 15,
266 
267     InvalidEnum = 16,
268     EnumCount   = 16,
269 };
270 
271 template <>
272 LogicalOperation FromGLenum<LogicalOperation>(GLenum from);
273 GLenum ToGLenum(LogicalOperation from);
274 std::ostream &operator<<(std::ostream &os, LogicalOperation value);
275 
276 enum class MaterialParameter : uint8_t
277 {
278     Ambient           = 0,
279     AmbientAndDiffuse = 1,
280     Diffuse           = 2,
281     Emission          = 3,
282     Shininess         = 4,
283     Specular          = 5,
284 
285     InvalidEnum = 6,
286     EnumCount   = 6,
287 };
288 
289 template <>
290 MaterialParameter FromGLenum<MaterialParameter>(GLenum from);
291 GLenum ToGLenum(MaterialParameter from);
292 std::ostream &operator<<(std::ostream &os, MaterialParameter value);
293 
294 enum class MatrixType : uint8_t
295 {
296     Modelview  = 0,
297     Projection = 1,
298     Texture    = 2,
299 
300     InvalidEnum = 3,
301     EnumCount   = 3,
302 };
303 
304 template <>
305 MatrixType FromGLenum<MatrixType>(GLenum from);
306 GLenum ToGLenum(MatrixType from);
307 std::ostream &operator<<(std::ostream &os, MatrixType value);
308 
309 enum class PointParameter : uint8_t
310 {
311     PointSizeMin             = 0,
312     PointSizeMax             = 1,
313     PointFadeThresholdSize   = 2,
314     PointDistanceAttenuation = 3,
315 
316     InvalidEnum = 4,
317     EnumCount   = 4,
318 };
319 
320 template <>
321 PointParameter FromGLenum<PointParameter>(GLenum from);
322 GLenum ToGLenum(PointParameter from);
323 std::ostream &operator<<(std::ostream &os, PointParameter value);
324 
325 enum class ProvokingVertexConvention : uint8_t
326 {
327     FirstVertexConvention = 0,
328     LastVertexConvention  = 1,
329 
330     InvalidEnum = 2,
331     EnumCount   = 2,
332 };
333 
334 template <>
335 ProvokingVertexConvention FromGLenum<ProvokingVertexConvention>(GLenum from);
336 GLenum ToGLenum(ProvokingVertexConvention from);
337 std::ostream &operator<<(std::ostream &os, ProvokingVertexConvention value);
338 
339 enum class QueryType : uint8_t
340 {
341     AnySamples                         = 0,
342     AnySamplesConservative             = 1,
343     CommandsCompleted                  = 2,
344     PrimitivesGenerated                = 3,
345     TimeElapsed                        = 4,
346     Timestamp                          = 5,
347     TransformFeedbackPrimitivesWritten = 6,
348 
349     InvalidEnum = 7,
350     EnumCount   = 7,
351 };
352 
353 template <>
354 QueryType FromGLenum<QueryType>(GLenum from);
355 GLenum ToGLenum(QueryType from);
356 std::ostream &operator<<(std::ostream &os, QueryType value);
357 
358 enum class ShaderType : uint8_t
359 {
360     Vertex   = 0,
361     Fragment = 1,
362     Geometry = 2,
363     Compute  = 3,
364 
365     InvalidEnum = 4,
366     EnumCount   = 4,
367 };
368 
369 template <>
370 ShaderType FromGLenum<ShaderType>(GLenum from);
371 GLenum ToGLenum(ShaderType from);
372 std::ostream &operator<<(std::ostream &os, ShaderType value);
373 
374 enum class ShadingModel : uint8_t
375 {
376     Flat   = 0,
377     Smooth = 1,
378 
379     InvalidEnum = 2,
380     EnumCount   = 2,
381 };
382 
383 template <>
384 ShadingModel FromGLenum<ShadingModel>(GLenum from);
385 GLenum ToGLenum(ShadingModel from);
386 std::ostream &operator<<(std::ostream &os, ShadingModel value);
387 
388 enum class TextureCombine : uint8_t
389 {
390     Add         = 0,
391     AddSigned   = 1,
392     Dot3Rgb     = 2,
393     Dot3Rgba    = 3,
394     Interpolate = 4,
395     Modulate    = 5,
396     Replace     = 6,
397     Subtract    = 7,
398 
399     InvalidEnum = 8,
400     EnumCount   = 8,
401 };
402 
403 template <>
404 TextureCombine FromGLenum<TextureCombine>(GLenum from);
405 GLenum ToGLenum(TextureCombine from);
406 std::ostream &operator<<(std::ostream &os, TextureCombine value);
407 
408 enum class TextureEnvMode : uint8_t
409 {
410     Add      = 0,
411     Blend    = 1,
412     Combine  = 2,
413     Decal    = 3,
414     Modulate = 4,
415     Replace  = 5,
416 
417     InvalidEnum = 6,
418     EnumCount   = 6,
419 };
420 
421 template <>
422 TextureEnvMode FromGLenum<TextureEnvMode>(GLenum from);
423 GLenum ToGLenum(TextureEnvMode from);
424 std::ostream &operator<<(std::ostream &os, TextureEnvMode value);
425 
426 enum class TextureEnvParameter : uint8_t
427 {
428     Mode              = 0,
429     Color             = 1,
430     CombineRgb        = 2,
431     CombineAlpha      = 3,
432     RgbScale          = 4,
433     AlphaScale        = 5,
434     Src0Rgb           = 6,
435     Src1Rgb           = 7,
436     Src2Rgb           = 8,
437     Src0Alpha         = 9,
438     Src1Alpha         = 10,
439     Src2Alpha         = 11,
440     Op0Rgb            = 12,
441     Op1Rgb            = 13,
442     Op2Rgb            = 14,
443     Op0Alpha          = 15,
444     Op1Alpha          = 16,
445     Op2Alpha          = 17,
446     PointCoordReplace = 18,
447 
448     InvalidEnum = 19,
449     EnumCount   = 19,
450 };
451 
452 template <>
453 TextureEnvParameter FromGLenum<TextureEnvParameter>(GLenum from);
454 GLenum ToGLenum(TextureEnvParameter from);
455 std::ostream &operator<<(std::ostream &os, TextureEnvParameter value);
456 
457 enum class TextureEnvTarget : uint8_t
458 {
459     Env         = 0,
460     PointSprite = 1,
461 
462     InvalidEnum = 2,
463     EnumCount   = 2,
464 };
465 
466 template <>
467 TextureEnvTarget FromGLenum<TextureEnvTarget>(GLenum from);
468 GLenum ToGLenum(TextureEnvTarget from);
469 std::ostream &operator<<(std::ostream &os, TextureEnvTarget value);
470 
471 enum class TextureOp : uint8_t
472 {
473     OneMinusSrcAlpha = 0,
474     OneMinusSrcColor = 1,
475     SrcAlpha         = 2,
476     SrcColor         = 3,
477 
478     InvalidEnum = 4,
479     EnumCount   = 4,
480 };
481 
482 template <>
483 TextureOp FromGLenum<TextureOp>(GLenum from);
484 GLenum ToGLenum(TextureOp from);
485 std::ostream &operator<<(std::ostream &os, TextureOp value);
486 
487 enum class TextureSrc : uint8_t
488 {
489     Constant     = 0,
490     Previous     = 1,
491     PrimaryColor = 2,
492     Texture      = 3,
493 
494     InvalidEnum = 4,
495     EnumCount   = 4,
496 };
497 
498 template <>
499 TextureSrc FromGLenum<TextureSrc>(GLenum from);
500 GLenum ToGLenum(TextureSrc from);
501 std::ostream &operator<<(std::ostream &os, TextureSrc value);
502 
503 enum class TextureTarget : uint8_t
504 {
505     _2D                 = 0,
506     _2DArray            = 1,
507     _2DMultisample      = 2,
508     _2DMultisampleArray = 3,
509     _3D                 = 4,
510     External            = 5,
511     Rectangle           = 6,
512     CubeMapPositiveX    = 7,
513     CubeMapNegativeX    = 8,
514     CubeMapPositiveY    = 9,
515     CubeMapNegativeY    = 10,
516     CubeMapPositiveZ    = 11,
517     CubeMapNegativeZ    = 12,
518     VideoImage          = 13,
519 
520     InvalidEnum = 14,
521     EnumCount   = 14,
522 };
523 
524 template <>
525 TextureTarget FromGLenum<TextureTarget>(GLenum from);
526 GLenum ToGLenum(TextureTarget from);
527 std::ostream &operator<<(std::ostream &os, TextureTarget value);
528 
529 enum class TextureType : uint8_t
530 {
531     _2D                 = 0,
532     _2DArray            = 1,
533     _2DMultisample      = 2,
534     _2DMultisampleArray = 3,
535     _3D                 = 4,
536     External            = 5,
537     Rectangle           = 6,
538     CubeMap             = 7,
539     VideoImage          = 8,
540 
541     InvalidEnum = 9,
542     EnumCount   = 9,
543 };
544 
545 template <>
546 TextureType FromGLenum<TextureType>(GLenum from);
547 GLenum ToGLenum(TextureType from);
548 std::ostream &operator<<(std::ostream &os, TextureType value);
549 
550 enum class VertexArrayType : uint8_t
551 {
552     Color        = 0,
553     Normal       = 1,
554     PointSize    = 2,
555     TextureCoord = 3,
556     Vertex       = 4,
557 
558     InvalidEnum = 5,
559     EnumCount   = 5,
560 };
561 
562 template <>
563 VertexArrayType FromGLenum<VertexArrayType>(GLenum from);
564 GLenum ToGLenum(VertexArrayType from);
565 std::ostream &operator<<(std::ostream &os, VertexArrayType value);
566 
567 enum class WrapMode : uint8_t
568 {
569     ClampToEdge    = 0,
570     ClampToBorder  = 1,
571     MirroredRepeat = 2,
572     Repeat         = 3,
573 
574     InvalidEnum = 4,
575     EnumCount   = 4,
576 };
577 
578 template <>
579 WrapMode FromGLenum<WrapMode>(GLenum from);
580 GLenum ToGLenum(WrapMode from);
581 std::ostream &operator<<(std::ostream &os, WrapMode value);
582 
583 }  // namespace gl
584 
585 #endif  // COMMON_PACKEDGLENUMS_AUTOGEN_H_
586