| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 bool may_enable_chromium_color_buffer_float = false; | 471 bool may_enable_chromium_color_buffer_float = false; |
| 472 | 472 |
| 473 if (extensions.Contains("GL_ARB_texture_float")) { | 473 if (extensions.Contains("GL_ARB_texture_float")) { |
| 474 enable_texture_float = true; | 474 enable_texture_float = true; |
| 475 enable_texture_float_linear = true; | 475 enable_texture_float_linear = true; |
| 476 enable_texture_half_float = true; | 476 enable_texture_half_float = true; |
| 477 enable_texture_half_float_linear = true; | 477 enable_texture_half_float_linear = true; |
| 478 may_enable_chromium_color_buffer_float = true; | 478 may_enable_chromium_color_buffer_float = true; |
| 479 } else { | 479 } else { |
| 480 if (is_es3 || extensions.Contains("GL_OES_texture_float")) { | 480 // GLES3 adds support for Float type by default but it doesn't support all |
| 481 // formats as GL_OES_texture_float(i.e.LUMINANCE_ALPHA,LUMINANCE and Alpha) |
| 482 if (extensions.Contains("GL_OES_texture_float")) { |
| 481 enable_texture_float = true; | 483 enable_texture_float = true; |
| 482 if (extensions.Contains("GL_OES_texture_float_linear")) { | 484 if (extensions.Contains("GL_OES_texture_float_linear")) { |
| 483 enable_texture_float_linear = true; | 485 enable_texture_float_linear = true; |
| 484 } | 486 } |
| 487 // This extension allows a variety of floating point formats to be |
| 488 // rendered to via framebuffer objects. Enable it's usage only if |
| 489 // support for Floating textures is enabled. |
| 485 if ((is_es3 && extensions.Contains("GL_EXT_color_buffer_float")) || | 490 if ((is_es3 && extensions.Contains("GL_EXT_color_buffer_float")) || |
| 486 feature_flags_.is_angle) { | 491 feature_flags_.is_angle) { |
| 487 may_enable_chromium_color_buffer_float = true; | 492 may_enable_chromium_color_buffer_float = true; |
| 488 } | 493 } |
| 489 } | 494 } |
| 495 |
| 490 // TODO(dshwang): GLES3 supports half float by default but GL_HALF_FLOAT_OES | 496 // TODO(dshwang): GLES3 supports half float by default but GL_HALF_FLOAT_OES |
| 491 // isn't equal to GL_HALF_FLOAT. | 497 // isn't equal to GL_HALF_FLOAT. |
| 492 if (extensions.Contains("GL_OES_texture_half_float")) { | 498 if (extensions.Contains("GL_OES_texture_half_float")) { |
| 493 enable_texture_half_float = true; | 499 enable_texture_half_float = true; |
| 494 if (extensions.Contains("GL_OES_texture_half_float_linear")) { | 500 if (extensions.Contains("GL_OES_texture_half_float_linear")) { |
| 495 enable_texture_half_float_linear = true; | 501 enable_texture_half_float_linear = true; |
| 496 } | 502 } |
| 497 } | 503 } |
| 498 } | 504 } |
| 499 | 505 |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 if (pos == std::string::npos) { | 942 if (pos == std::string::npos) { |
| 937 extensions_ += (extensions_.empty() ? "" : " ") + str; | 943 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 938 } | 944 } |
| 939 } | 945 } |
| 940 | 946 |
| 941 FeatureInfo::~FeatureInfo() { | 947 FeatureInfo::~FeatureInfo() { |
| 942 } | 948 } |
| 943 | 949 |
| 944 } // namespace gles2 | 950 } // namespace gles2 |
| 945 } // namespace gpu | 951 } // namespace gpu |
| OLD | NEW |