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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 if (enable_texture_float) { | 427 if (enable_texture_float) { |
428 texture_format_validators_[GL_ALPHA].AddValue(GL_FLOAT); | 428 texture_format_validators_[GL_ALPHA].AddValue(GL_FLOAT); |
429 texture_format_validators_[GL_RGB].AddValue(GL_FLOAT); | 429 texture_format_validators_[GL_RGB].AddValue(GL_FLOAT); |
430 texture_format_validators_[GL_RGBA].AddValue(GL_FLOAT); | 430 texture_format_validators_[GL_RGBA].AddValue(GL_FLOAT); |
431 texture_format_validators_[GL_LUMINANCE].AddValue(GL_FLOAT); | 431 texture_format_validators_[GL_LUMINANCE].AddValue(GL_FLOAT); |
432 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_FLOAT); | 432 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_FLOAT); |
433 validators_.pixel_type.AddValue(GL_FLOAT); | 433 validators_.pixel_type.AddValue(GL_FLOAT); |
434 validators_.read_pixel_type.AddValue(GL_FLOAT); | |
435 AddExtensionString("GL_OES_texture_float"); | 434 AddExtensionString("GL_OES_texture_float"); |
436 if (enable_texture_float_linear) { | 435 if (enable_texture_float_linear) { |
437 AddExtensionString("GL_OES_texture_float_linear"); | 436 AddExtensionString("GL_OES_texture_float_linear"); |
438 } | 437 } |
439 } | 438 } |
440 | 439 |
441 if (enable_texture_half_float) { | 440 if (enable_texture_half_float) { |
442 texture_format_validators_[GL_ALPHA].AddValue(GL_HALF_FLOAT_OES); | 441 texture_format_validators_[GL_ALPHA].AddValue(GL_HALF_FLOAT_OES); |
443 texture_format_validators_[GL_RGB].AddValue(GL_HALF_FLOAT_OES); | 442 texture_format_validators_[GL_RGB].AddValue(GL_HALF_FLOAT_OES); |
444 texture_format_validators_[GL_RGBA].AddValue(GL_HALF_FLOAT_OES); | 443 texture_format_validators_[GL_RGBA].AddValue(GL_HALF_FLOAT_OES); |
445 texture_format_validators_[GL_LUMINANCE].AddValue(GL_HALF_FLOAT_OES); | 444 texture_format_validators_[GL_LUMINANCE].AddValue(GL_HALF_FLOAT_OES); |
446 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES); | 445 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES); |
447 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); | 446 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); |
448 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES); | |
449 AddExtensionString("GL_OES_texture_half_float"); | 447 AddExtensionString("GL_OES_texture_half_float"); |
450 if (enable_texture_half_float_linear) { | 448 if (enable_texture_half_float_linear) { |
451 AddExtensionString("GL_OES_texture_half_float_linear"); | 449 AddExtensionString("GL_OES_texture_half_float_linear"); |
452 } | 450 } |
453 } | 451 } |
454 | 452 |
453 bool enable_color_buffer_half_float = false; | |
454 if (extensions.Contains("GL_ARB_color_buffer_float") | |
455 || extensions.Contains("GL_EXT_color_buffer_half_float")) { | |
456 if (enable_texture_half_float) | |
457 enable_color_buffer_half_float = true; | |
458 } | |
459 if (enable_color_buffer_half_float) { | |
460 validators_.render_buffer_format.AddValue(GL_RGBA16F_EXT); | |
461 validators_.render_buffer_format.AddValue(GL_RGB16F_EXT); | |
462 validators_.frame_buffer_parameter.AddValue( | |
463 GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT); | |
464 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES); | |
465 validators_.read_pixel_type.AddValue(GL_FLOAT); | |
Ken Russell (switch to Gerrit)
2013/07/10 02:14:24
There's a general problem with this patch and the
| |
466 AddExtensionString("GL_EXT_color_buffer_half_float"); | |
467 } | |
468 | |
455 // Check for multisample support | 469 // Check for multisample support |
456 bool ext_has_multisample = | 470 bool ext_has_multisample = |
457 extensions.Contains("GL_EXT_framebuffer_multisample"); | 471 extensions.Contains("GL_EXT_framebuffer_multisample"); |
458 if (!workarounds_.disable_angle_framebuffer_multisample) { | 472 if (!workarounds_.disable_angle_framebuffer_multisample) { |
459 ext_has_multisample |= | 473 ext_has_multisample |= |
460 extensions.Contains("GL_ANGLE_framebuffer_multisample"); | 474 extensions.Contains("GL_ANGLE_framebuffer_multisample"); |
461 } | 475 } |
462 if (!disallowed_features_.multisampling && ext_has_multisample) { | 476 if (!disallowed_features_.multisampling && ext_has_multisample) { |
463 feature_flags_.chromium_framebuffer_multisample = true; | 477 feature_flags_.chromium_framebuffer_multisample = true; |
464 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); | 478 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
655 if (extensions_.find(str) == std::string::npos) { | 669 if (extensions_.find(str) == std::string::npos) { |
656 extensions_ += (extensions_.empty() ? "" : " ") + str; | 670 extensions_ += (extensions_.empty() ? "" : " ") + str; |
657 } | 671 } |
658 } | 672 } |
659 | 673 |
660 FeatureInfo::~FeatureInfo() { | 674 FeatureInfo::~FeatureInfo() { |
661 } | 675 } |
662 | 676 |
663 } // namespace gles2 | 677 } // namespace gles2 |
664 } // namespace gpu | 678 } // namespace gpu |
OLD | NEW |