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 | ANGLE_texture_multisample, |
23 | ARM_shader_framebuffer_fetch, |
24 | EXT_blend_func_extended, |
25 | EXT_draw_buffers, |
26 | EXT_frag_depth, |
27 | EXT_geometry_shader, |
28 | EXT_shader_framebuffer_fetch, |
29 | EXT_shader_texture_lod, |
30 | EXT_YUV_target, |
31 | NV_EGL_stream_consumer_external, |
32 | NV_shader_framebuffer_fetch, |
33 | OES_EGL_image_external, |
34 | OES_EGL_image_external_essl3, |
35 | OES_standard_derivatives, |
36 | OES_texture_storage_multisample_2d_array, |
37 | OVR_multiview2, |
38 | ANGLE_multi_draw, |
39 | }; |
40 | |
41 | enum TBehavior |
42 | { |
43 | EBhRequire, |
44 | EBhEnable, |
45 | EBhWarn, |
46 | EBhDisable, |
47 | EBhUndefined |
48 | }; |
49 | |
50 | const char *GetExtensionNameString(TExtension extension); |
51 | TExtension GetExtensionByName(const char *extension); |
52 | |
53 | const char *GetBehaviorString(TBehavior b); |
54 | |
55 | // Mapping between extension id and behavior. |
56 | typedef std::map<TExtension, TBehavior> TExtensionBehavior; |
57 | |
58 | bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension); |
59 | |
60 | } // namespace sh |
61 | |
62 | #endif // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_ |
63 | |