Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 enable_samplers(false), | 127 enable_samplers(false), |
| 128 ext_draw_buffers(false), | 128 ext_draw_buffers(false), |
| 129 ext_frag_depth(false), | 129 ext_frag_depth(false), |
| 130 use_async_readpixels(false), | 130 use_async_readpixels(false), |
| 131 map_buffer_range(false), | 131 map_buffer_range(false), |
| 132 ext_discard_framebuffer(false), | 132 ext_discard_framebuffer(false), |
| 133 angle_depth_texture(false), | 133 angle_depth_texture(false), |
| 134 is_angle(false), | 134 is_angle(false), |
| 135 is_swiftshader(false), | 135 is_swiftshader(false), |
| 136 angle_texture_usage(false), | 136 angle_texture_usage(false), |
| 137 ext_texture_storage(false) { | 137 ext_texture_storage(false), |
| 138 } | 138 arb_sync(false) {} |
| 139 | 139 |
| 140 FeatureInfo::Workarounds::Workarounds() : | 140 FeatureInfo::Workarounds::Workarounds() : |
| 141 #define GPU_OP(type, name) name(false), | 141 #define GPU_OP(type, name) name(false), |
| 142 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 142 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 143 #undef GPU_OP | 143 #undef GPU_OP |
| 144 max_texture_size(0), | 144 max_texture_size(0), |
| 145 max_cube_map_texture_size(0) { | 145 max_cube_map_texture_size(0) { |
| 146 } | 146 } |
| 147 | 147 |
| 148 FeatureInfo::FeatureInfo() { | 148 FeatureInfo::FeatureInfo() { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 AddExtensionString("GL_CHROMIUM_command_buffer_query"); | 239 AddExtensionString("GL_CHROMIUM_command_buffer_query"); |
| 240 AddExtensionString("GL_CHROMIUM_command_buffer_latency_query"); | 240 AddExtensionString("GL_CHROMIUM_command_buffer_latency_query"); |
| 241 AddExtensionString("GL_CHROMIUM_copy_texture"); | 241 AddExtensionString("GL_CHROMIUM_copy_texture"); |
| 242 AddExtensionString("GL_CHROMIUM_get_error_query"); | 242 AddExtensionString("GL_CHROMIUM_get_error_query"); |
| 243 AddExtensionString("GL_CHROMIUM_lose_context"); | 243 AddExtensionString("GL_CHROMIUM_lose_context"); |
| 244 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); | 244 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); |
| 245 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); | 245 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); |
| 246 AddExtensionString("GL_CHROMIUM_resize"); | 246 AddExtensionString("GL_CHROMIUM_resize"); |
| 247 AddExtensionString("GL_CHROMIUM_resource_safe"); | 247 AddExtensionString("GL_CHROMIUM_resource_safe"); |
| 248 AddExtensionString("GL_CHROMIUM_strict_attribs"); | 248 AddExtensionString("GL_CHROMIUM_strict_attribs"); |
| 249 AddExtensionString("GL_CHROMIUM_sync_query"); | |
| 249 AddExtensionString("GL_CHROMIUM_texture_mailbox"); | 250 AddExtensionString("GL_CHROMIUM_texture_mailbox"); |
| 250 AddExtensionString("GL_EXT_debug_marker"); | 251 AddExtensionString("GL_EXT_debug_marker"); |
| 251 | 252 |
| 252 // OES_vertex_array_object is emulated if not present natively, | 253 // OES_vertex_array_object is emulated if not present natively, |
| 253 // so the extension string is always exposed. | 254 // so the extension string is always exposed. |
| 254 AddExtensionString("GL_OES_vertex_array_object"); | 255 AddExtensionString("GL_OES_vertex_array_object"); |
| 255 | 256 |
| 256 if (!disallowed_features_.gpu_memory_manager) | 257 if (!disallowed_features_.gpu_memory_manager) |
| 257 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); | 258 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); |
| 258 | 259 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 771 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
| 771 // when available. | 772 // when available. |
| 772 } | 773 } |
| 773 | 774 |
| 774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && | 775 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && |
| 775 !workarounds_.disable_ext_discard_framebuffer) { | 776 !workarounds_.disable_ext_discard_framebuffer) { |
| 776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 777 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
| 777 AddExtensionString("GL_EXT_discard_framebuffer"); | 778 AddExtensionString("GL_EXT_discard_framebuffer"); |
| 778 feature_flags_.ext_discard_framebuffer = true; | 779 feature_flags_.ext_discard_framebuffer = true; |
| 779 } | 780 } |
| 781 | |
| 782 if (is_es3 || extensions.Contains("GL_ARB_sync")) | |
| 783 feature_flags_.arb_sync = true; | |
|
no sievers
2014/04/15 18:41:15
I missed that es3 has this.
We should update gl_fe
| |
| 780 } | 784 } |
| 781 | 785 |
| 782 void FeatureInfo::AddExtensionString(const std::string& str) { | 786 void FeatureInfo::AddExtensionString(const std::string& str) { |
| 783 size_t pos = extensions_.find(str); | 787 size_t pos = extensions_.find(str); |
| 784 while (pos != std::string::npos && | 788 while (pos != std::string::npos && |
| 785 pos + str.length() < extensions_.length() && | 789 pos + str.length() < extensions_.length() && |
| 786 extensions_.substr(pos + str.length(), 1) != " ") { | 790 extensions_.substr(pos + str.length(), 1) != " ") { |
| 787 // This extension name is a substring of another. | 791 // This extension name is a substring of another. |
| 788 pos = extensions_.find(str, pos + str.length()); | 792 pos = extensions_.find(str, pos + str.length()); |
| 789 } | 793 } |
| 790 if (pos == std::string::npos) { | 794 if (pos == std::string::npos) { |
| 791 extensions_ += (extensions_.empty() ? "" : " ") + str; | 795 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 792 } | 796 } |
| 793 } | 797 } |
| 794 | 798 |
| 795 FeatureInfo::~FeatureInfo() { | 799 FeatureInfo::~FeatureInfo() { |
| 796 } | 800 } |
| 797 | 801 |
| 798 } // namespace gles2 | 802 } // namespace gles2 |
| 799 } // namespace gpu | 803 } // namespace gpu |
| OLD | NEW |