• 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     ANGLE_base_vertex_base_instance_shader_builtin,
23     ANGLE_multi_draw,
24     ANGLE_texture_multisample,
25     APPLE_clip_distance,
26     ARB_texture_rectangle,
27     ARM_shader_framebuffer_fetch,
28     EXT_blend_func_extended,
29     EXT_clip_cull_distance,
30     EXT_draw_buffers,
31     EXT_frag_depth,
32     EXT_geometry_shader,
33     OES_geometry_shader,
34     OES_shader_io_blocks,
35     EXT_shader_io_blocks,
36     EXT_gpu_shader5,
37     EXT_primitive_bounding_box,
38     EXT_shader_framebuffer_fetch,
39     EXT_shader_framebuffer_fetch_non_coherent,
40     EXT_shader_non_constant_global_initializers,
41     EXT_shader_texture_lod,
42     EXT_shadow_samplers,
43     EXT_tessellation_shader,
44     EXT_texture_buffer,
45     EXT_texture_cube_map_array,
46     EXT_YUV_target,
47     NV_EGL_stream_consumer_external,
48     NV_shader_framebuffer_fetch,
49     NV_shader_noperspective_interpolation,
50     OES_EGL_image_external,
51     OES_EGL_image_external_essl3,
52     OES_sample_variables,
53     OES_shader_multisample_interpolation,
54     OES_shader_image_atomic,
55     OES_standard_derivatives,
56     OES_texture_3D,
57     OES_texture_buffer,
58     OES_texture_cube_map_array,
59     OES_texture_storage_multisample_2d_array,
60     OVR_multiview,
61     OVR_multiview2,
62     WEBGL_video_texture,
63 };
64 
65 enum TBehavior : uint8_t
66 {
67     EBhRequire,
68     EBhEnable,
69     EBhWarn,
70     EBhDisable,
71     EBhUndefined
72 };
73 
74 const char *GetExtensionNameString(TExtension extension);
75 TExtension GetExtensionByName(const char *extension);
76 
77 const char *GetBehaviorString(TBehavior b);
78 
79 // Mapping between extension id and behavior.
80 typedef std::map<TExtension, TBehavior> TExtensionBehavior;
81 
82 bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension);
83 
84 }  // namespace sh
85 
86 #endif  // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
87