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 <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_gpu_shader5, 29 EXT_shader_framebuffer_fetch, 30 EXT_shader_texture_lod, 31 EXT_YUV_target, 32 EXT_shader_non_constant_global_initializers, 33 NV_EGL_stream_consumer_external, 34 NV_shader_framebuffer_fetch, 35 NV_shader_noperspective_interpolation, 36 OES_EGL_image_external, 37 OES_EGL_image_external_essl3, 38 OES_standard_derivatives, 39 OES_texture_storage_multisample_2d_array, 40 OES_texture_3D, 41 OVR_multiview, 42 OVR_multiview2, 43 ANGLE_multi_draw, 44 ANGLE_base_vertex_base_instance, 45 WEBGL_video_texture, 46 }; 47 48 enum TBehavior 49 { 50 EBhRequire, 51 EBhEnable, 52 EBhWarn, 53 EBhDisable, 54 EBhUndefined 55 }; 56 57 const char *GetExtensionNameString(TExtension extension); 58 TExtension GetExtensionByName(const char *extension); 59 60 const char *GetBehaviorString(TBehavior b); 61 62 // Mapping between extension id and behavior. 63 typedef std::map<TExtension, TBehavior> TExtensionBehavior; 64 65 bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension); 66 67 } // namespace sh 68 69 #endif // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_ 70