| 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 | 1400 |
| 1401 if (gl_version_info_->IsLowerThanGL(4, 3)) { | 1401 if (gl_version_info_->IsLowerThanGL(4, 3)) { |
| 1402 // crbug.com/481184. | 1402 // crbug.com/481184. |
| 1403 // GL_PRIMITIVE_RESTART_FIXED_INDEX is only available on Desktop GL 4.3+, | 1403 // GL_PRIMITIVE_RESTART_FIXED_INDEX is only available on Desktop GL 4.3+, |
| 1404 // but we emulate ES 3.0 on top of Desktop GL 4.2+. | 1404 // but we emulate ES 3.0 on top of Desktop GL 4.2+. |
| 1405 feature_flags_.emulate_primitive_restart_fixed_index = true; | 1405 feature_flags_.emulate_primitive_restart_fixed_index = true; |
| 1406 } | 1406 } |
| 1407 } | 1407 } |
| 1408 | 1408 |
| 1409 bool FeatureInfo::IsES3Capable() const { | 1409 bool FeatureInfo::IsES3Capable() const { |
| 1410 if (testing_es3_apis_enabled_) |
| 1411 return true; |
| 1410 if (!enable_unsafe_es3_apis_switch_) | 1412 if (!enable_unsafe_es3_apis_switch_) |
| 1411 return false; | 1413 return false; |
| 1412 if (workarounds_.disable_texture_storage) | 1414 if (workarounds_.disable_texture_storage) |
| 1413 return false; | 1415 return false; |
| 1414 if (gl_version_info_) | 1416 if (gl_version_info_) |
| 1415 return gl_version_info_->is_es3_capable; | 1417 return gl_version_info_->is_es3_capable; |
| 1416 return false; | 1418 return false; |
| 1417 } | 1419 } |
| 1418 | 1420 |
| 1421 void FeatureInfo::EnableES3ValidatorsForTesting() { |
| 1422 testing_es3_apis_enabled_ = true; |
| 1423 EnableES3Validators(); |
| 1424 } |
| 1425 |
| 1419 void FeatureInfo::EnableES3Validators() { | 1426 void FeatureInfo::EnableES3Validators() { |
| 1420 DCHECK(IsES3Capable()); | 1427 DCHECK(IsES3Capable()); |
| 1421 validators_.UpdateValuesES3(); | 1428 validators_.UpdateValuesES3(); |
| 1422 | 1429 |
| 1423 GLint max_color_attachments = 0; | 1430 GLint max_color_attachments = 0; |
| 1424 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments); | 1431 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments); |
| 1425 const int kTotalColorAttachmentEnums = 16; | 1432 const int kTotalColorAttachmentEnums = 16; |
| 1426 const GLenum kColorAttachments[] = { | 1433 const GLenum kColorAttachments[] = { |
| 1427 GL_COLOR_ATTACHMENT0, | 1434 GL_COLOR_ATTACHMENT0, |
| 1428 GL_COLOR_ATTACHMENT1, | 1435 GL_COLOR_ATTACHMENT1, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 if (pos == std::string::npos) { | 1555 if (pos == std::string::npos) { |
| 1549 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1556 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1550 } | 1557 } |
| 1551 } | 1558 } |
| 1552 | 1559 |
| 1553 FeatureInfo::~FeatureInfo() { | 1560 FeatureInfo::~FeatureInfo() { |
| 1554 } | 1561 } |
| 1555 | 1562 |
| 1556 } // namespace gles2 | 1563 } // namespace gles2 |
| 1557 } // namespace gpu | 1564 } // namespace gpu |
| OLD | NEW |