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, 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_shader_framebuffer_fetch, 38 EXT_shader_framebuffer_fetch_non_coherent, 39 EXT_shader_non_constant_global_initializers, 40 EXT_shader_texture_lod, 41 EXT_shadow_samplers, 42 EXT_tessellation_shader, 43 EXT_texture_buffer, 44 EXT_texture_cube_map_array, 45 EXT_YUV_target, 46 NV_EGL_stream_consumer_external, 47 NV_shader_framebuffer_fetch, 48 NV_shader_noperspective_interpolation, 49 OES_EGL_image_external, 50 OES_EGL_image_external_essl3, 51 OES_sample_variables, 52 OES_shader_multisample_interpolation, 53 OES_shader_image_atomic, 54 OES_standard_derivatives, 55 OES_texture_3D, 56 OES_texture_buffer, 57 OES_texture_cube_map_array, 58 OES_texture_storage_multisample_2d_array, 59 OVR_multiview, 60 OVR_multiview2, 61 WEBGL_video_texture, 62 }; 63 64 enum TBehavior : uint8_t 65 { 66 EBhRequire, 67 EBhEnable, 68 EBhWarn, 69 EBhDisable, 70 EBhUndefined 71 }; 72 73 const char *GetExtensionNameString(TExtension extension); 74 TExtension GetExtensionByName(const char *extension); 75 76 const char *GetBehaviorString(TBehavior b); 77 78 // Mapping between extension id and behavior. 79 typedef std::map<TExtension, TBehavior> TExtensionBehavior; 80 81 bool IsExtensionEnabled(const TExtensionBehavior &extBehavior, TExtension extension); 82 83 } // namespace sh 84 85 #endif // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_ 86