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