| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 use_async_readpixels(false), | 138 use_async_readpixels(false), |
| 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 enable_subscribe_uniform(false) { |
| 149 } | 150 } |
| 150 | 151 |
| 151 FeatureInfo::Workarounds::Workarounds() : | 152 FeatureInfo::Workarounds::Workarounds() : |
| 152 #define GPU_OP(type, name) name(false), | 153 #define GPU_OP(type, name) name(false), |
| 153 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 154 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 154 #undef GPU_OP | 155 #undef GPU_OP |
| 155 max_texture_size(0), | 156 max_texture_size(0), |
| 156 max_cube_map_texture_size(0), | 157 max_cube_map_texture_size(0), |
| 157 max_fragment_uniform_vectors(0), | 158 max_fragment_uniform_vectors(0), |
| 158 max_varying_vectors(0), | 159 max_varying_vectors(0), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 172 std::string types = command_line.GetSwitchValueASCII( | 173 std::string types = command_line.GetSwitchValueASCII( |
| 173 switches::kGpuDriverBugWorkarounds); | 174 switches::kGpuDriverBugWorkarounds); |
| 174 StringToWorkarounds(types, &workarounds_); | 175 StringToWorkarounds(types, &workarounds_); |
| 175 } | 176 } |
| 176 feature_flags_.enable_shader_name_hashing = | 177 feature_flags_.enable_shader_name_hashing = |
| 177 !command_line.HasSwitch(switches::kDisableShaderNameHashing); | 178 !command_line.HasSwitch(switches::kDisableShaderNameHashing); |
| 178 | 179 |
| 179 feature_flags_.is_swiftshader = | 180 feature_flags_.is_swiftshader = |
| 180 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 181 (command_line.GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| 181 | 182 |
| 183 feature_flags_.enable_subscribe_uniform = |
| 184 command_line.HasSwitch(switches::kEnableSubscribeUniformExtension); |
| 185 |
| 182 static const GLenum kAlphaTypes[] = { | 186 static const GLenum kAlphaTypes[] = { |
| 183 GL_UNSIGNED_BYTE, | 187 GL_UNSIGNED_BYTE, |
| 184 }; | 188 }; |
| 185 static const GLenum kRGBTypes[] = { | 189 static const GLenum kRGBTypes[] = { |
| 186 GL_UNSIGNED_BYTE, | 190 GL_UNSIGNED_BYTE, |
| 187 GL_UNSIGNED_SHORT_5_6_5, | 191 GL_UNSIGNED_SHORT_5_6_5, |
| 188 }; | 192 }; |
| 189 static const GLenum kRGBATypes[] = { | 193 static const GLenum kRGBATypes[] = { |
| 190 GL_UNSIGNED_BYTE, | 194 GL_UNSIGNED_BYTE, |
| 191 GL_UNSIGNED_SHORT_4_4_4_4, | 195 GL_UNSIGNED_SHORT_4_4_4_4, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 AddExtensionString("GL_CHROMIUM_get_error_query"); | 258 AddExtensionString("GL_CHROMIUM_get_error_query"); |
| 255 AddExtensionString("GL_CHROMIUM_lose_context"); | 259 AddExtensionString("GL_CHROMIUM_lose_context"); |
| 256 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); | 260 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); |
| 257 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); | 261 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); |
| 258 AddExtensionString("GL_CHROMIUM_resize"); | 262 AddExtensionString("GL_CHROMIUM_resize"); |
| 259 AddExtensionString("GL_CHROMIUM_resource_safe"); | 263 AddExtensionString("GL_CHROMIUM_resource_safe"); |
| 260 AddExtensionString("GL_CHROMIUM_strict_attribs"); | 264 AddExtensionString("GL_CHROMIUM_strict_attribs"); |
| 261 AddExtensionString("GL_CHROMIUM_texture_mailbox"); | 265 AddExtensionString("GL_CHROMIUM_texture_mailbox"); |
| 262 AddExtensionString("GL_EXT_debug_marker"); | 266 AddExtensionString("GL_EXT_debug_marker"); |
| 263 | 267 |
| 268 if (feature_flags_.enable_subscribe_uniform) { |
| 269 AddExtensionString("GL_CHROMIUM_subscribe_uniform"); |
| 270 } |
| 271 |
| 264 // OES_vertex_array_object is emulated if not present natively, | 272 // OES_vertex_array_object is emulated if not present natively, |
| 265 // so the extension string is always exposed. | 273 // so the extension string is always exposed. |
| 266 AddExtensionString("GL_OES_vertex_array_object"); | 274 AddExtensionString("GL_OES_vertex_array_object"); |
| 267 | 275 |
| 268 if (!disallowed_features_.gpu_memory_manager) | 276 if (!disallowed_features_.gpu_memory_manager) |
| 269 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); | 277 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); |
| 270 | 278 |
| 271 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { | 279 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { |
| 272 feature_flags_.angle_translated_shader_source = true; | 280 feature_flags_.angle_translated_shader_source = true; |
| 273 } | 281 } |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 if (pos == std::string::npos) { | 955 if (pos == std::string::npos) { |
| 948 extensions_ += (extensions_.empty() ? "" : " ") + str; | 956 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 949 } | 957 } |
| 950 } | 958 } |
| 951 | 959 |
| 952 FeatureInfo::~FeatureInfo() { | 960 FeatureInfo::~FeatureInfo() { |
| 953 } | 961 } |
| 954 | 962 |
| 955 } // namespace gles2 | 963 } // namespace gles2 |
| 956 } // namespace gpu | 964 } // namespace gpu |
| OLD | NEW |