| 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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 if (enable_texture_float) { | 428 if (enable_texture_float) { |
| 429 texture_format_validators_[GL_ALPHA].AddValue(GL_FLOAT); | 429 texture_format_validators_[GL_ALPHA].AddValue(GL_FLOAT); |
| 430 texture_format_validators_[GL_RGB].AddValue(GL_FLOAT); | 430 texture_format_validators_[GL_RGB].AddValue(GL_FLOAT); |
| 431 texture_format_validators_[GL_RGBA].AddValue(GL_FLOAT); | 431 texture_format_validators_[GL_RGBA].AddValue(GL_FLOAT); |
| 432 texture_format_validators_[GL_LUMINANCE].AddValue(GL_FLOAT); | 432 texture_format_validators_[GL_LUMINANCE].AddValue(GL_FLOAT); |
| 433 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_FLOAT); | 433 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_FLOAT); |
| 434 validators_.pixel_type.AddValue(GL_FLOAT); | 434 validators_.pixel_type.AddValue(GL_FLOAT); |
| 435 validators_.read_pixel_type.AddValue(GL_FLOAT); | |
| 436 AddExtensionString("GL_OES_texture_float"); | 435 AddExtensionString("GL_OES_texture_float"); |
| 437 if (enable_texture_float_linear) { | 436 if (enable_texture_float_linear) { |
| 438 AddExtensionString("GL_OES_texture_float_linear"); | 437 AddExtensionString("GL_OES_texture_float_linear"); |
| 439 } | 438 } |
| 440 } | 439 } |
| 441 | 440 |
| 442 if (enable_texture_half_float) { | 441 if (enable_texture_half_float) { |
| 443 texture_format_validators_[GL_ALPHA].AddValue(GL_HALF_FLOAT_OES); | 442 texture_format_validators_[GL_ALPHA].AddValue(GL_HALF_FLOAT_OES); |
| 444 texture_format_validators_[GL_RGB].AddValue(GL_HALF_FLOAT_OES); | 443 texture_format_validators_[GL_RGB].AddValue(GL_HALF_FLOAT_OES); |
| 445 texture_format_validators_[GL_RGBA].AddValue(GL_HALF_FLOAT_OES); | 444 texture_format_validators_[GL_RGBA].AddValue(GL_HALF_FLOAT_OES); |
| 446 texture_format_validators_[GL_LUMINANCE].AddValue(GL_HALF_FLOAT_OES); | 445 texture_format_validators_[GL_LUMINANCE].AddValue(GL_HALF_FLOAT_OES); |
| 447 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES); | 446 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES); |
| 448 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); | 447 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); |
| 449 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES); | |
| 450 AddExtensionString("GL_OES_texture_half_float"); | 448 AddExtensionString("GL_OES_texture_half_float"); |
| 451 if (enable_texture_half_float_linear) { | 449 if (enable_texture_half_float_linear) { |
| 452 AddExtensionString("GL_OES_texture_half_float_linear"); | 450 AddExtensionString("GL_OES_texture_half_float_linear"); |
| 453 } | 451 } |
| 454 } | 452 } |
| 455 | 453 |
| 454 bool enable_color_buffer_float = false; |
| 455 if (extensions.Contains("GL_ARB_color_buffer_float") |
| 456 || extensions.Contains("GL_ANGLE_color_buffer_float")) { |
| 457 if (enable_texture_float) |
| 458 enable_color_buffer_float = true; |
| 459 } |
| 460 if (enable_color_buffer_float) { |
| 461 validators_.render_buffer_format.AddValue(GL_RGBA32F_EXT); |
| 462 validators_.render_buffer_format.AddValue(GL_RGB32F_EXT); |
| 463 AddExtensionString("GL_ANGLE_color_buffer_float"); |
| 464 } |
| 465 |
| 466 bool enable_color_buffer_half_float = false; |
| 467 if (extensions.Contains("GL_ARB_color_buffer_float") |
| 468 || extensions.Contains("GL_EXT_color_buffer_half_float")) { |
| 469 if (enable_texture_half_float) |
| 470 enable_color_buffer_half_float = true; |
| 471 } |
| 472 if (enable_color_buffer_half_float) { |
| 473 validators_.render_buffer_format.AddValue(GL_RGBA16F_EXT); |
| 474 validators_.render_buffer_format.AddValue(GL_RGB16F_EXT); |
| 475 // FIXME: read_pixel_type check should be improved. |
| 476 // Only two format/type combinations are supported, one is |
| 477 // RGBA/UNSIGNED_BYTE or RGBA/FLOAT, another is implementation-chosen |
| 478 // format and type that can be queried. |
| 479 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES); |
| 480 AddExtensionString("GL_EXT_color_buffer_half_float"); |
| 481 } |
| 482 |
| 483 if (enable_color_buffer_float || enable_color_buffer_half_float) { |
| 484 validators_.frame_buffer_parameter.AddValue( |
| 485 GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT); |
| 486 // FIXME: read_pixel_type check should be improved. |
| 487 // Only two format/type combinations are supported, one is |
| 488 // RGBA/UNSIGNED_BYTE or RGBA/FLOAT, another is implementation-chosen |
| 489 // format and type that can be queried. |
| 490 validators_.read_pixel_type.AddValue(GL_FLOAT); |
| 491 } |
| 492 |
| 456 // Check for multisample support | 493 // Check for multisample support |
| 457 if (!disallowed_features_.multisampling) { | 494 if (!disallowed_features_.multisampling) { |
| 458 bool ext_has_multisample = | 495 bool ext_has_multisample = |
| 459 extensions.Contains("GL_EXT_framebuffer_multisample"); | 496 extensions.Contains("GL_EXT_framebuffer_multisample"); |
| 460 if (!workarounds_.disable_angle_framebuffer_multisample) { | 497 if (!workarounds_.disable_angle_framebuffer_multisample) { |
| 461 ext_has_multisample |= | 498 ext_has_multisample |= |
| 462 extensions.Contains("GL_ANGLE_framebuffer_multisample"); | 499 extensions.Contains("GL_ANGLE_framebuffer_multisample"); |
| 463 } | 500 } |
| 464 if (ext_has_multisample) { | 501 if (ext_has_multisample) { |
| 465 feature_flags_.chromium_framebuffer_multisample = true; | 502 feature_flags_.chromium_framebuffer_multisample = true; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 if (extensions_.find(str) == std::string::npos) { | 700 if (extensions_.find(str) == std::string::npos) { |
| 664 extensions_ += (extensions_.empty() ? "" : " ") + str; | 701 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 665 } | 702 } |
| 666 } | 703 } |
| 667 | 704 |
| 668 FeatureInfo::~FeatureInfo() { | 705 FeatureInfo::~FeatureInfo() { |
| 669 } | 706 } |
| 670 | 707 |
| 671 } // namespace gles2 | 708 } // namespace gles2 |
| 672 } // namespace gpu | 709 } // namespace gpu |
| OLD | NEW |