Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 18492005: Add GL_EXT_multisampled_render_to_texture support to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved ahead to TOT Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (workarounds->max_cube_map_texture_size_limit_1024) 93 if (workarounds->max_cube_map_texture_size_limit_1024)
94 workarounds->max_cube_map_texture_size = 1024; 94 workarounds->max_cube_map_texture_size = 1024;
95 if (workarounds->max_cube_map_texture_size_limit_512) 95 if (workarounds->max_cube_map_texture_size_limit_512)
96 workarounds->max_cube_map_texture_size = 512; 96 workarounds->max_cube_map_texture_size = 512;
97 } 97 }
98 98
99 } // anonymous namespace. 99 } // anonymous namespace.
100 100
101 FeatureInfo::FeatureFlags::FeatureFlags() 101 FeatureInfo::FeatureFlags::FeatureFlags()
102 : chromium_framebuffer_multisample(false), 102 : chromium_framebuffer_multisample(false),
103 multisampled_render_to_texture(false),
104 use_img_for_multisampled_render_to_texture(false),
103 oes_standard_derivatives(false), 105 oes_standard_derivatives(false),
104 oes_egl_image_external(false), 106 oes_egl_image_external(false),
105 npot_ok(false), 107 npot_ok(false),
106 enable_texture_float_linear(false), 108 enable_texture_float_linear(false),
107 enable_texture_half_float_linear(false), 109 enable_texture_half_float_linear(false),
108 chromium_stream_texture(false), 110 chromium_stream_texture(false),
109 angle_translated_shader_source(false), 111 angle_translated_shader_source(false),
110 angle_pack_reverse_row_order(false), 112 angle_pack_reverse_row_order(false),
111 arb_texture_rectangle(false), 113 arb_texture_rectangle(false),
112 angle_instanced_arrays(false), 114 angle_instanced_arrays(false),
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES); 448 texture_format_validators_[GL_LUMINANCE_ALPHA].AddValue(GL_HALF_FLOAT_OES);
447 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); 449 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES);
448 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES); 450 validators_.read_pixel_type.AddValue(GL_HALF_FLOAT_OES);
449 AddExtensionString("GL_OES_texture_half_float"); 451 AddExtensionString("GL_OES_texture_half_float");
450 if (enable_texture_half_float_linear) { 452 if (enable_texture_half_float_linear) {
451 AddExtensionString("GL_OES_texture_half_float_linear"); 453 AddExtensionString("GL_OES_texture_half_float_linear");
452 } 454 }
453 } 455 }
454 456
455 // Check for multisample support 457 // Check for multisample support
456 bool ext_has_multisample = 458 if (!disallowed_features_.multisampling) {
457 extensions.Contains("GL_EXT_framebuffer_multisample"); 459 bool ext_has_multisample =
458 if (!workarounds_.disable_angle_framebuffer_multisample) { 460 extensions.Contains("GL_EXT_framebuffer_multisample");
459 ext_has_multisample |= 461 if (!workarounds_.disable_angle_framebuffer_multisample) {
460 extensions.Contains("GL_ANGLE_framebuffer_multisample"); 462 ext_has_multisample |=
461 } 463 extensions.Contains("GL_ANGLE_framebuffer_multisample");
462 if (!disallowed_features_.multisampling && ext_has_multisample) { 464 }
463 feature_flags_.chromium_framebuffer_multisample = true; 465 if (ext_has_multisample) {
464 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); 466 feature_flags_.chromium_framebuffer_multisample = true;
465 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); 467 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT);
466 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); 468 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT);
467 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); 469 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT);
468 validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); 470 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT);
469 AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); 471 validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT);
472 AddExtensionString("GL_CHROMIUM_framebuffer_multisample");
473 } else {
474 if (extensions.Contains("GL_EXT_multisampled_render_to_texture")) {
475 feature_flags_.multisampled_render_to_texture = true;
476 } else if (extensions.Contains("GL_IMG_multisampled_render_to_texture")) {
477 feature_flags_.multisampled_render_to_texture = true;
478 feature_flags_.use_img_for_multisampled_render_to_texture = true;
479 }
480 if (feature_flags_.multisampled_render_to_texture) {
481 validators_.render_buffer_parameter.AddValue(
482 GL_RENDERBUFFER_SAMPLES_EXT);
483 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT);
484 validators_.frame_buffer_parameter.AddValue(
485 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT);
486 AddExtensionString("GL_EXT_multisampled_render_to_texture");
487 }
488 }
470 } 489 }
471 490
472 if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures()) { 491 if (extensions.Contains("GL_OES_depth24") || gfx::HasDesktopGLFeatures()) {
473 AddExtensionString("GL_OES_depth24"); 492 AddExtensionString("GL_OES_depth24");
474 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); 493 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24);
475 } 494 }
476 495
477 if (!workarounds_.disable_oes_standard_derivatives && 496 if (!workarounds_.disable_oes_standard_derivatives &&
478 (extensions.Contains("GL_OES_standard_derivatives") || 497 (extensions.Contains("GL_OES_standard_derivatives") ||
479 gfx::HasDesktopGLFeatures())) { 498 gfx::HasDesktopGLFeatures())) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 if (extensions_.find(str) == std::string::npos) { 674 if (extensions_.find(str) == std::string::npos) {
656 extensions_ += (extensions_.empty() ? "" : " ") + str; 675 extensions_ += (extensions_.empty() ? "" : " ") + str;
657 } 676 }
658 } 677 }
659 678
660 FeatureInfo::~FeatureInfo() { 679 FeatureInfo::~FeatureInfo() {
661 } 680 }
662 681
663 } // namespace gles2 682 } // namespace gles2
664 } // namespace gpu 683 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698