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

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

Issue 12545014: Implement EXT_draw_buffers WebGL extention support in command buffer. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 chromium_stream_texture(false), 74 chromium_stream_texture(false),
75 angle_translated_shader_source(false), 75 angle_translated_shader_source(false),
76 angle_pack_reverse_row_order(false), 76 angle_pack_reverse_row_order(false),
77 arb_texture_rectangle(false), 77 arb_texture_rectangle(false),
78 angle_instanced_arrays(false), 78 angle_instanced_arrays(false),
79 occlusion_query_boolean(false), 79 occlusion_query_boolean(false),
80 use_arb_occlusion_query2_for_occlusion_query_boolean(false), 80 use_arb_occlusion_query2_for_occlusion_query_boolean(false),
81 use_arb_occlusion_query_for_occlusion_query_boolean(false), 81 use_arb_occlusion_query_for_occlusion_query_boolean(false),
82 native_vertex_array_object(false), 82 native_vertex_array_object(false),
83 disable_workarounds(false), 83 disable_workarounds(false),
84 enable_shader_name_hashing(false) { 84 enable_shader_name_hashing(false),
85 ext_draw_buffers(false) {
85 } 86 }
86 87
87 FeatureInfo::Workarounds::Workarounds() 88 FeatureInfo::Workarounds::Workarounds()
88 : clear_alpha_in_readpixels(false), 89 : clear_alpha_in_readpixels(false),
89 needs_glsl_built_in_function_emulation(false), 90 needs_glsl_built_in_function_emulation(false),
90 needs_offscreen_buffer_workaround(false), 91 needs_offscreen_buffer_workaround(false),
91 reverse_point_sprite_coord_origin(false), 92 reverse_point_sprite_coord_origin(false),
92 set_texture_filter_before_generating_mipmap(false), 93 set_texture_filter_before_generating_mipmap(false),
93 use_current_program_after_successful_link(false), 94 use_current_program_after_successful_link(false),
94 restore_scissor_on_fbo_change(false), 95 restore_scissor_on_fbo_change(false),
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 607 }
607 608
608 if (extensions.Contains("GL_ANGLE_instanced_arrays") || 609 if (extensions.Contains("GL_ANGLE_instanced_arrays") ||
609 (extensions.Contains("GL_ARB_instanced_arrays") && 610 (extensions.Contains("GL_ARB_instanced_arrays") &&
610 extensions.Contains("GL_ARB_draw_instanced"))) { 611 extensions.Contains("GL_ARB_draw_instanced"))) {
611 AddExtensionString("GL_ANGLE_instanced_arrays"); 612 AddExtensionString("GL_ANGLE_instanced_arrays");
612 feature_flags_.angle_instanced_arrays = true; 613 feature_flags_.angle_instanced_arrays = true;
613 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE); 614 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
614 } 615 }
615 616
617 if (extensions.Contains("GL_ARB_draw_buffers")) {
618 AddExtensionString("GL_EXT_draw_buffers");
619 feature_flags_.ext_draw_buffers = true;
620
621 GLint max_color_attachments = 0;
622 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments);
623 for (GLenum i = GL_COLOR_ATTACHMENT1_EXT;
624 i < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + max_color_attachments);
625 ++i) {
626 validators_.attachment.AddValue(i);
627 }
628
629 validators_.g_l_state.AddValue(GL_MAX_COLOR_ATTACHMENTS_EXT);
630 validators_.g_l_state.AddValue(GL_MAX_DRAW_BUFFERS_ARB);
631 GLint max_draw_buffers = 0;
632 glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers);
633 for (GLenum i = GL_DRAW_BUFFER0_ARB;
634 i < static_cast<GLenum>(GL_DRAW_BUFFER0_ARB + max_draw_buffers);
635 ++i) {
636 validators_.g_l_state.AddValue(i);
637 }
638 }
639
616 if (!disallowed_features_.swap_buffer_complete_callback) 640 if (!disallowed_features_.swap_buffer_complete_callback)
617 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); 641 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
618 642
619 if (!feature_flags_.disable_workarounds) { 643 if (!feature_flags_.disable_workarounds) {
620 workarounds_.set_texture_filter_before_generating_mipmap = true; 644 workarounds_.set_texture_filter_before_generating_mipmap = true;
621 workarounds_.clear_alpha_in_readpixels = true; 645 workarounds_.clear_alpha_in_readpixels = true;
622 646
623 if (is_nvidia) { 647 if (is_nvidia) {
624 workarounds_.use_current_program_after_successful_link = true; 648 workarounds_.use_current_program_after_successful_link = true;
625 } 649 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 if (extensions_.find(str) == std::string::npos) { 693 if (extensions_.find(str) == std::string::npos) {
670 extensions_ += (extensions_.empty() ? "" : " ") + str; 694 extensions_ += (extensions_.empty() ? "" : " ") + str;
671 } 695 }
672 } 696 }
673 697
674 FeatureInfo::~FeatureInfo() { 698 FeatureInfo::~FeatureInfo() {
675 } 699 }
676 700
677 } // namespace gles2 701 } // namespace gles2
678 } // namespace gpu 702 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/framebuffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698