1 //
2 // Copyright (c) 2002-2010 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 <map>
13 
14 namespace sh
15 {
16 
17 enum class TExtension
18 {
19     UNDEFINED,  // Special value used to indicate no extension.
20 
21     ARB_texture_rectangle,
22     ARM_shader_framebuffer_fetch,
23     EXT_blend_func_extended,
24     EXT_draw_buffers,
25     EXT_frag_depth,
26     EXT_geometry_shader,
27     EXT_shader_framebuffer_fetch,
28     EXT_shader_texture_lod,
29     EXT_YUV_target,
30     NV_EGL_stream_consumer_external,
31     NV_shader_framebuffer_fetch,
32     OES_EGL_image_external,
33     OES_EGL_image_external_essl3,
34     OES_geometry_shader,
35     OES_standard_derivatives,
36     OVR_multiview
37 };
38 
39 enum TBehavior
40 {
41     EBhRequire,
42     EBhEnable,
43     EBhWarn,
44     EBhDisable,
45     EBhUndefined
46 };
47 
48 const char *GetExtensionNameString(TExtension extension);
49 TExtension GetExtensionByName(const char *extension);
50 
51 const char *GetBehaviorString(TBehavior b);
52 
53 // Mapping between extension id and behavior.
54 typedef std::map<TExtension, TBehavior> TExtensionBehavior;
55 
56 bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension);
57 
58 }  // namespace sh
59 
60 #endif  // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
61