| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 is_swiftshader(false), | 123 is_swiftshader(false), |
| 124 angle_texture_usage(false), | 124 angle_texture_usage(false), |
| 125 ext_texture_storage(false), | 125 ext_texture_storage(false), |
| 126 chromium_path_rendering(false), | 126 chromium_path_rendering(false), |
| 127 chromium_framebuffer_mixed_samples(false), | 127 chromium_framebuffer_mixed_samples(false), |
| 128 blend_equation_advanced(false), | 128 blend_equation_advanced(false), |
| 129 blend_equation_advanced_coherent(false), | 129 blend_equation_advanced_coherent(false), |
| 130 ext_texture_rg(false), | 130 ext_texture_rg(false), |
| 131 chromium_image_ycbcr_420v(false), | 131 chromium_image_ycbcr_420v(false), |
| 132 chromium_image_ycbcr_422(false), | 132 chromium_image_ycbcr_422(false), |
| 133 enable_subscribe_uniform(false), | |
| 134 emulate_primitive_restart_fixed_index(false), | 133 emulate_primitive_restart_fixed_index(false), |
| 135 ext_render_buffer_format_bgra8888(false), | 134 ext_render_buffer_format_bgra8888(false), |
| 136 ext_multisample_compatibility(false), | 135 ext_multisample_compatibility(false), |
| 137 ext_blend_func_extended(false), | 136 ext_blend_func_extended(false), |
| 138 ext_read_format_bgra(false) {} | 137 ext_read_format_bgra(false) {} |
| 139 | 138 |
| 140 FeatureInfo::FeatureInfo() { | 139 FeatureInfo::FeatureInfo() { |
| 141 InitializeBasicState(base::CommandLine::InitializedForCurrentProcess() | 140 InitializeBasicState(base::CommandLine::InitializedForCurrentProcess() |
| 142 ? base::CommandLine::ForCurrentProcess() | 141 ? base::CommandLine::ForCurrentProcess() |
| 143 : nullptr); | 142 : nullptr); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 161 void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { | 160 void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { |
| 162 if (!command_line) | 161 if (!command_line) |
| 163 return; | 162 return; |
| 164 | 163 |
| 165 feature_flags_.enable_shader_name_hashing = | 164 feature_flags_.enable_shader_name_hashing = |
| 166 !command_line->HasSwitch(switches::kDisableShaderNameHashing); | 165 !command_line->HasSwitch(switches::kDisableShaderNameHashing); |
| 167 | 166 |
| 168 feature_flags_.is_swiftshader = | 167 feature_flags_.is_swiftshader = |
| 169 (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 168 (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| 170 | 169 |
| 171 feature_flags_.enable_subscribe_uniform = | |
| 172 command_line->HasSwitch(switches::kEnableSubscribeUniformExtension); | |
| 173 | |
| 174 enable_unsafe_es3_apis_switch_ = | 170 enable_unsafe_es3_apis_switch_ = |
| 175 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 171 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
| 176 | 172 |
| 177 // The shader translator is needed to translate from WebGL-conformant GLES SL | 173 // The shader translator is needed to translate from WebGL-conformant GLES SL |
| 178 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to | 174 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to |
| 179 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, | 175 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, |
| 180 // etc. | 176 // etc. |
| 181 // The flag here is for testing only. | 177 // The flag here is for testing only. |
| 182 disable_shader_translator_ = | 178 disable_shader_translator_ = |
| 183 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 179 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 AddExtensionString("GL_CHROMIUM_trace_marker"); | 332 AddExtensionString("GL_CHROMIUM_trace_marker"); |
| 337 AddExtensionString("GL_EXT_debug_marker"); | 333 AddExtensionString("GL_EXT_debug_marker"); |
| 338 | 334 |
| 339 // Pre es3, there are no PBOS and all unpack state is handled in client side. | 335 // Pre es3, there are no PBOS and all unpack state is handled in client side. |
| 340 // With es3, unpack state is needed in server side. We always mark these | 336 // With es3, unpack state is needed in server side. We always mark these |
| 341 // enums as valid and pass them to drivers only when a valid PBO is bound. | 337 // enums as valid and pass them to drivers only when a valid PBO is bound. |
| 342 // UNPACK_ROW_LENGTH, UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS are enabled, | 338 // UNPACK_ROW_LENGTH, UNPACK_SKIP_ROWS, and UNPACK_SKIP_PIXELS are enabled, |
| 343 // but there is no need to add them to pixel_store validtor. | 339 // but there is no need to add them to pixel_store validtor. |
| 344 AddExtensionString("GL_EXT_unpack_subimage"); | 340 AddExtensionString("GL_EXT_unpack_subimage"); |
| 345 | 341 |
| 346 if (feature_flags_.enable_subscribe_uniform) { | |
| 347 AddExtensionString("GL_CHROMIUM_subscribe_uniform"); | |
| 348 } | |
| 349 | |
| 350 // OES_vertex_array_object is emulated if not present natively, | 342 // OES_vertex_array_object is emulated if not present natively, |
| 351 // so the extension string is always exposed. | 343 // so the extension string is always exposed. |
| 352 AddExtensionString("GL_OES_vertex_array_object"); | 344 AddExtensionString("GL_OES_vertex_array_object"); |
| 353 | 345 |
| 354 if (!disallowed_features_.gpu_memory_manager) | 346 if (!disallowed_features_.gpu_memory_manager) |
| 355 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); | 347 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); |
| 356 | 348 |
| 357 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { | 349 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { |
| 358 feature_flags_.angle_translated_shader_source = true; | 350 feature_flags_.angle_translated_shader_source = true; |
| 359 } | 351 } |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 if (pos == std::string::npos) { | 1362 if (pos == std::string::npos) { |
| 1371 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1363 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1372 } | 1364 } |
| 1373 } | 1365 } |
| 1374 | 1366 |
| 1375 FeatureInfo::~FeatureInfo() { | 1367 FeatureInfo::~FeatureInfo() { |
| 1376 } | 1368 } |
| 1377 | 1369 |
| 1378 } // namespace gles2 | 1370 } // namespace gles2 |
| 1379 } // namespace gpu | 1371 } // namespace gpu |
| OLD | NEW |