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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 validators_.texture_internal_format.AddValue(GL_BGRA_EXT); | 647 validators_.texture_internal_format.AddValue(GL_BGRA_EXT); |
648 validators_.texture_format.AddValue(GL_BGRA_EXT); | 648 validators_.texture_format.AddValue(GL_BGRA_EXT); |
649 validators_.texture_unsized_internal_format.AddValue(GL_BGRA_EXT); | 649 validators_.texture_unsized_internal_format.AddValue(GL_BGRA_EXT); |
650 } | 650 } |
651 | 651 |
652 if (enable_read_format_bgra) { | 652 if (enable_read_format_bgra) { |
653 AddExtensionString("GL_EXT_read_format_bgra"); | 653 AddExtensionString("GL_EXT_read_format_bgra"); |
654 validators_.read_pixel_format.AddValue(GL_BGRA_EXT); | 654 validators_.read_pixel_format.AddValue(GL_BGRA_EXT); |
655 } | 655 } |
656 | 656 |
657 // We only support timer queries if we also support glGetInteger64v. | 657 // glGetInteger64v for timestamps is implemented on the client side in a way |
658 // For GL_EXT_disjoint_timer_query, glGetInteger64v is only support under ES3. | 658 // that it does not depend on a driver-level implementation of |
659 if ((gl_version_info_->is_es3 && | 659 // glGetInteger64v. The GPUTimer class which implements timer queries can also |
660 extensions.Contains("GL_EXT_disjoint_timer_query")) || | 660 // fallback to an implementation that does not depend on glGetInteget64v on |
| 661 // ES2. Thus we can enable GL_EXT_disjoint_timer_query on ES2 contexts even |
| 662 // though it does not support glGetInteger64v due to a specification bug. |
| 663 if (extensions.Contains("GL_EXT_disjoint_timer_query") || |
661 extensions.Contains("GL_ARB_timer_query") || | 664 extensions.Contains("GL_ARB_timer_query") || |
662 extensions.Contains("GL_EXT_timer_query")) { | 665 extensions.Contains("GL_EXT_timer_query")) { |
663 AddExtensionString("GL_EXT_disjoint_timer_query"); | 666 AddExtensionString("GL_EXT_disjoint_timer_query"); |
664 } | 667 } |
665 | 668 |
666 if (enable_render_buffer_bgra) { | 669 if (enable_render_buffer_bgra) { |
667 feature_flags_.ext_render_buffer_format_bgra8888 = true; | 670 feature_flags_.ext_render_buffer_format_bgra8888 = true; |
668 AddExtensionString("GL_CHROMIUM_renderbuffer_format_BGRA8888"); | 671 AddExtensionString("GL_CHROMIUM_renderbuffer_format_BGRA8888"); |
669 validators_.render_buffer_format.AddValue(GL_BGRA8_EXT); | 672 validators_.render_buffer_format.AddValue(GL_BGRA8_EXT); |
670 } | 673 } |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 if (pos == std::string::npos) { | 1438 if (pos == std::string::npos) { |
1436 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1439 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1437 } | 1440 } |
1438 } | 1441 } |
1439 | 1442 |
1440 FeatureInfo::~FeatureInfo() { | 1443 FeatureInfo::~FeatureInfo() { |
1441 } | 1444 } |
1442 | 1445 |
1443 } // namespace gles2 | 1446 } // namespace gles2 |
1444 } // namespace gpu | 1447 } // namespace gpu |
OLD | NEW |