| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 map_buffer_range(false), | 139 map_buffer_range(false), |
| 140 ext_discard_framebuffer(false), | 140 ext_discard_framebuffer(false), |
| 141 angle_depth_texture(false), | 141 angle_depth_texture(false), |
| 142 is_angle(false), | 142 is_angle(false), |
| 143 is_swiftshader(false), | 143 is_swiftshader(false), |
| 144 angle_texture_usage(false), | 144 angle_texture_usage(false), |
| 145 ext_texture_storage(false), | 145 ext_texture_storage(false), |
| 146 chromium_path_rendering(false), | 146 chromium_path_rendering(false), |
| 147 blend_equation_advanced(false), | 147 blend_equation_advanced(false), |
| 148 blend_equation_advanced_coherent(false), | 148 blend_equation_advanced_coherent(false), |
| 149 ext_texture_rg(false) { | 149 ext_texture_rg(false), |
| 150 enable_subscribe_uniform(false) { |
| 150 } | 151 } |
| 151 | 152 |
| 152 FeatureInfo::Workarounds::Workarounds() : | 153 FeatureInfo::Workarounds::Workarounds() : |
| 153 #define GPU_OP(type, name) name(false), | 154 #define GPU_OP(type, name) name(false), |
| 154 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 155 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 155 #undef GPU_OP | 156 #undef GPU_OP |
| 156 max_texture_size(0), | 157 max_texture_size(0), |
| 157 max_cube_map_texture_size(0), | 158 max_cube_map_texture_size(0), |
| 158 max_fragment_uniform_vectors(0), | 159 max_fragment_uniform_vectors(0), |
| 159 max_varying_vectors(0), | 160 max_varying_vectors(0), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 173 std::string types = command_line.GetSwitchValueASCII( | 174 std::string types = command_line.GetSwitchValueASCII( |
| 174 switches::kGpuDriverBugWorkarounds); | 175 switches::kGpuDriverBugWorkarounds); |
| 175 StringToWorkarounds(types, &workarounds_); | 176 StringToWorkarounds(types, &workarounds_); |
| 176 } | 177 } |
| 177 feature_flags_.enable_shader_name_hashing = | 178 feature_flags_.enable_shader_name_hashing = |
| 178 !command_line.HasSwitch(switches::kDisableShaderNameHashing); | 179 !command_line.HasSwitch(switches::kDisableShaderNameHashing); |
| 179 | 180 |
| 180 feature_flags_.is_swiftshader = | 181 feature_flags_.is_swiftshader = |
| 181 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 182 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| 182 | 183 |
| 184 feature_flags_.enable_subscribe_uniform = |
| 185 command_line.HasSwitch(switches::kEnableSubscribeUniformExtension); |
| 186 |
| 183 static const GLenum kAlphaTypes[] = { | 187 static const GLenum kAlphaTypes[] = { |
| 184 GL_UNSIGNED_BYTE, | 188 GL_UNSIGNED_BYTE, |
| 185 }; | 189 }; |
| 186 static const GLenum kRGBTypes[] = { | 190 static const GLenum kRGBTypes[] = { |
| 187 GL_UNSIGNED_BYTE, | 191 GL_UNSIGNED_BYTE, |
| 188 GL_UNSIGNED_SHORT_5_6_5, | 192 GL_UNSIGNED_SHORT_5_6_5, |
| 189 }; | 193 }; |
| 190 static const GLenum kRGBATypes[] = { | 194 static const GLenum kRGBATypes[] = { |
| 191 GL_UNSIGNED_BYTE, | 195 GL_UNSIGNED_BYTE, |
| 192 GL_UNSIGNED_SHORT_4_4_4_4, | 196 GL_UNSIGNED_SHORT_4_4_4_4, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 AddExtensionString("GL_CHROMIUM_get_error_query"); | 292 AddExtensionString("GL_CHROMIUM_get_error_query"); |
| 289 AddExtensionString("GL_CHROMIUM_lose_context"); | 293 AddExtensionString("GL_CHROMIUM_lose_context"); |
| 290 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); | 294 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); |
| 291 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); | 295 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); |
| 292 AddExtensionString("GL_CHROMIUM_resize"); | 296 AddExtensionString("GL_CHROMIUM_resize"); |
| 293 AddExtensionString("GL_CHROMIUM_resource_safe"); | 297 AddExtensionString("GL_CHROMIUM_resource_safe"); |
| 294 AddExtensionString("GL_CHROMIUM_strict_attribs"); | 298 AddExtensionString("GL_CHROMIUM_strict_attribs"); |
| 295 AddExtensionString("GL_CHROMIUM_texture_mailbox"); | 299 AddExtensionString("GL_CHROMIUM_texture_mailbox"); |
| 296 AddExtensionString("GL_EXT_debug_marker"); | 300 AddExtensionString("GL_EXT_debug_marker"); |
| 297 | 301 |
| 302 if (feature_flags_.enable_subscribe_uniform) { |
| 303 AddExtensionString("GL_CHROMIUM_subscribe_uniform"); |
| 304 } |
| 305 |
| 298 // OES_vertex_array_object is emulated if not present natively, | 306 // OES_vertex_array_object is emulated if not present natively, |
| 299 // so the extension string is always exposed. | 307 // so the extension string is always exposed. |
| 300 AddExtensionString("GL_OES_vertex_array_object"); | 308 AddExtensionString("GL_OES_vertex_array_object"); |
| 301 | 309 |
| 302 if (!disallowed_features_.gpu_memory_manager) | 310 if (!disallowed_features_.gpu_memory_manager) |
| 303 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); | 311 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); |
| 304 | 312 |
| 305 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { | 313 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { |
| 306 feature_flags_.angle_translated_shader_source = true; | 314 feature_flags_.angle_translated_shader_source = true; |
| 307 } | 315 } |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 if (pos == std::string::npos) { | 1023 if (pos == std::string::npos) { |
| 1016 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1024 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1017 } | 1025 } |
| 1018 } | 1026 } |
| 1019 | 1027 |
| 1020 FeatureInfo::~FeatureInfo() { | 1028 FeatureInfo::~FeatureInfo() { |
| 1021 } | 1029 } |
| 1022 | 1030 |
| 1023 } // namespace gles2 | 1031 } // namespace gles2 |
| 1024 } // namespace gpu | 1032 } // namespace gpu |
| OLD | NEW |