• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2002 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // ExtensionBehavior.h: Extension name enumeration and data structures for storing extension
7 // behavior.
8 
9 #ifndef COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
10 #define COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
11 
12 #include <cstdint>
13 #include <map>
14 
15 namespace sh
16 {
17 
18 enum class TExtension : uint8_t
19 {
20     UNDEFINED,  // Special value used to indicate no extension.
21 
22     ARB_texture_rectangle,
23     ANGLE_texture_multisample,
24     ARM_shader_framebuffer_fetch,
25     EXT_blend_func_extended,
26     EXT_draw_buffers,
27     EXT_frag_depth,
28     EXT_geometry_shader,
29     EXT_gpu_shader5,
30     EXT_shader_framebuffer_fetch,
31     EXT_shader_texture_lod,
32     EXT_YUV_target,
33     EXT_shader_non_constant_global_initializers,
34     NV_EGL_stream_consumer_external,
35     NV_shader_framebuffer_fetch,
36     NV_shader_noperspective_interpolation,
37     OES_EGL_image_external,
38     OES_EGL_image_external_essl3,
39     OES_standard_derivatives,
40     OES_texture_storage_multisample_2d_array,
41     OES_texture_3D,
42     OVR_multiview,
43     OVR_multiview2,
44     ANGLE_multi_draw,
45     ANGLE_base_vertex_base_instance,
46     WEBGL_video_texture,
47     APPLE_clip_distance,
48     OES_texture_cube_map_array,
49     EXT_texture_cube_map_array,
50 };
51 
52 enum TBehavior : uint8_t
53 {
54     EBhRequire,
55     EBhEnable,
56     EBhWarn,
57     EBhDisable,
58     EBhUndefined
59 };
60 
61 const char *GetExtensionNameString(TExtension extension);
62 TExtension GetExtensionByName(const char *extension);
63 
64 const char *GetBehaviorString(TBehavior b);
65 
66 // Mapping between extension id and behavior.
67 typedef std::map<TExtension, TBehavior> TExtensionBehavior;
68 
69 bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension);
70 
71 }  // namespace sh
72 
73 #endif  // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
74