| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 arb_texture_rectangle(false), | 125 arb_texture_rectangle(false), |
| 126 angle_instanced_arrays(false), | 126 angle_instanced_arrays(false), |
| 127 occlusion_query_boolean(false), | 127 occlusion_query_boolean(false), |
| 128 use_arb_occlusion_query2_for_occlusion_query_boolean(false), | 128 use_arb_occlusion_query2_for_occlusion_query_boolean(false), |
| 129 use_arb_occlusion_query_for_occlusion_query_boolean(false), | 129 use_arb_occlusion_query_for_occlusion_query_boolean(false), |
| 130 native_vertex_array_object(false), | 130 native_vertex_array_object(false), |
| 131 ext_texture_format_bgra8888(false), | 131 ext_texture_format_bgra8888(false), |
| 132 enable_shader_name_hashing(false), | 132 enable_shader_name_hashing(false), |
| 133 enable_samplers(false), | 133 enable_samplers(false), |
| 134 ext_draw_buffers(false), | 134 ext_draw_buffers(false), |
| 135 nv_draw_buffers(false), |
| 135 ext_frag_depth(false), | 136 ext_frag_depth(false), |
| 136 ext_shader_texture_lod(false), | 137 ext_shader_texture_lod(false), |
| 137 use_async_readpixels(false), | 138 use_async_readpixels(false), |
| 138 map_buffer_range(false), | 139 map_buffer_range(false), |
| 139 ext_discard_framebuffer(false), | 140 ext_discard_framebuffer(false), |
| 140 angle_depth_texture(false), | 141 angle_depth_texture(false), |
| 141 is_angle(false), | 142 is_angle(false), |
| 142 is_swiftshader(false), | 143 is_swiftshader(false), |
| 143 angle_texture_usage(false), | 144 angle_texture_usage(false), |
| 144 ext_texture_storage(false), | 145 ext_texture_storage(false), |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 if (!workarounds_.disable_angle_instanced_arrays && | 754 if (!workarounds_.disable_angle_instanced_arrays && |
| 754 (extensions.Contains("GL_ANGLE_instanced_arrays") || | 755 (extensions.Contains("GL_ANGLE_instanced_arrays") || |
| 755 (extensions.Contains("GL_ARB_instanced_arrays") && | 756 (extensions.Contains("GL_ARB_instanced_arrays") && |
| 756 extensions.Contains("GL_ARB_draw_instanced")) || | 757 extensions.Contains("GL_ARB_draw_instanced")) || |
| 757 is_es3)) { | 758 is_es3)) { |
| 758 AddExtensionString("GL_ANGLE_instanced_arrays"); | 759 AddExtensionString("GL_ANGLE_instanced_arrays"); |
| 759 feature_flags_.angle_instanced_arrays = true; | 760 feature_flags_.angle_instanced_arrays = true; |
| 760 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE); | 761 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE); |
| 761 } | 762 } |
| 762 | 763 |
| 764 bool vendor_agnostic_draw_buffers = |
| 765 extensions.Contains("GL_ARB_draw_buffers") || |
| 766 extensions.Contains("GL_EXT_draw_buffers"); |
| 763 if (!workarounds_.disable_ext_draw_buffers && | 767 if (!workarounds_.disable_ext_draw_buffers && |
| 764 (extensions.Contains("GL_ARB_draw_buffers") || | 768 (vendor_agnostic_draw_buffers || |
| 765 extensions.Contains("GL_EXT_draw_buffers"))) { | 769 (extensions.Contains("GL_NV_draw_buffers") && is_es3))) { |
| 766 AddExtensionString("GL_EXT_draw_buffers"); | 770 AddExtensionString("GL_EXT_draw_buffers"); |
| 767 feature_flags_.ext_draw_buffers = true; | 771 feature_flags_.ext_draw_buffers = true; |
| 772 feature_flags_.nv_draw_buffers = !vendor_agnostic_draw_buffers; |
| 768 | 773 |
| 769 GLint max_color_attachments = 0; | 774 GLint max_color_attachments = 0; |
| 770 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments); | 775 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments); |
| 771 for (GLenum i = GL_COLOR_ATTACHMENT1_EXT; | 776 for (GLenum i = GL_COLOR_ATTACHMENT1_EXT; |
| 772 i < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + max_color_attachments); | 777 i < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + max_color_attachments); |
| 773 ++i) { | 778 ++i) { |
| 774 validators_.attachment.AddValue(i); | 779 validators_.attachment.AddValue(i); |
| 775 } | 780 } |
| 776 COMPILE_ASSERT(GL_COLOR_ATTACHMENT0_EXT == GL_COLOR_ATTACHMENT0, | 781 COMPILE_ASSERT(GL_COLOR_ATTACHMENT0_EXT == GL_COLOR_ATTACHMENT0, |
| 777 color_attachment0_variation_must_match); | 782 color_attachment0_variation_must_match); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 if (pos == std::string::npos) { | 877 if (pos == std::string::npos) { |
| 873 extensions_ += (extensions_.empty() ? "" : " ") + str; | 878 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 874 } | 879 } |
| 875 } | 880 } |
| 876 | 881 |
| 877 FeatureInfo::~FeatureInfo() { | 882 FeatureInfo::~FeatureInfo() { |
| 878 } | 883 } |
| 879 | 884 |
| 880 } // namespace gles2 | 885 } // namespace gles2 |
| 881 } // namespace gpu | 886 } // namespace gpu |
| OLD | NEW |