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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 } // anonymous namespace. | 83 } // anonymous namespace. |
84 | 84 |
85 FeatureInfo::FeatureFlags::FeatureFlags() | 85 FeatureInfo::FeatureFlags::FeatureFlags() |
86 : chromium_framebuffer_multisample(false), | 86 : chromium_framebuffer_multisample(false), |
87 chromium_sync_query(false), | 87 chromium_sync_query(false), |
88 use_core_framebuffer_multisample(false), | 88 use_core_framebuffer_multisample(false), |
89 multisampled_render_to_texture(false), | 89 multisampled_render_to_texture(false), |
90 use_img_for_multisampled_render_to_texture(false), | 90 use_img_for_multisampled_render_to_texture(false), |
91 chromium_screen_space_antialiasing(false), | 91 chromium_screen_space_antialiasing(false), |
| 92 use_chromium_screen_space_antialiasing_via_shaders(false), |
92 oes_standard_derivatives(false), | 93 oes_standard_derivatives(false), |
93 oes_egl_image_external(false), | 94 oes_egl_image_external(false), |
94 nv_egl_stream_consumer_external(false), | 95 nv_egl_stream_consumer_external(false), |
95 oes_depth24(false), | 96 oes_depth24(false), |
96 oes_compressed_etc1_rgb8_texture(false), | 97 oes_compressed_etc1_rgb8_texture(false), |
97 packed_depth24_stencil8(false), | 98 packed_depth24_stencil8(false), |
98 npot_ok(false), | 99 npot_ok(false), |
99 enable_texture_float_linear(false), | 100 enable_texture_float_linear(false), |
100 enable_texture_half_float_linear(false), | 101 enable_texture_half_float_linear(false), |
101 angle_translated_shader_source(false), | 102 angle_translated_shader_source(false), |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 173 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
173 | 174 |
174 // The shader translator is needed to translate from WebGL-conformant GLES SL | 175 // The shader translator is needed to translate from WebGL-conformant GLES SL |
175 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to | 176 // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to |
176 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, | 177 // target context GLSL, implement emulation of OpenGL ES features on OpenGL, |
177 // etc. | 178 // etc. |
178 // The flag here is for testing only. | 179 // The flag here is for testing only. |
179 disable_shader_translator_ = | 180 disable_shader_translator_ = |
180 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 181 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
181 | 182 |
| 183 enable_cmaa_shaders_switch_ = |
| 184 command_line->HasSwitch(switches::kEnableCMAAShaders); |
| 185 |
182 unsafe_es3_apis_enabled_ = false; | 186 unsafe_es3_apis_enabled_ = false; |
183 | 187 |
184 // Default context_type_ to a GLES2 Context. | 188 // Default context_type_ to a GLES2 Context. |
185 context_type_ = CONTEXT_TYPE_OPENGLES2; | 189 context_type_ = CONTEXT_TYPE_OPENGLES2; |
186 | 190 |
187 chromium_color_buffer_float_rgba_available_ = false; | 191 chromium_color_buffer_float_rgba_available_ = false; |
188 chromium_color_buffer_float_rgb_available_ = false; | 192 chromium_color_buffer_float_rgb_available_ = false; |
189 ext_color_buffer_float_available_ = false; | 193 ext_color_buffer_float_available_ = false; |
190 oes_texture_float_linear_available_ = false; | 194 oes_texture_float_linear_available_ = false; |
191 oes_texture_half_float_linear_available_ = false; | 195 oes_texture_half_float_linear_available_ = false; |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 extensions.Contains("GL_EXT_multisample_compatibility")) { | 878 extensions.Contains("GL_EXT_multisample_compatibility")) { |
875 AddExtensionString("GL_EXT_multisample_compatibility"); | 879 AddExtensionString("GL_EXT_multisample_compatibility"); |
876 feature_flags_.ext_multisample_compatibility = true; | 880 feature_flags_.ext_multisample_compatibility = true; |
877 validators_.capability.AddValue(GL_MULTISAMPLE_EXT); | 881 validators_.capability.AddValue(GL_MULTISAMPLE_EXT); |
878 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); | 882 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); |
879 } | 883 } |
880 | 884 |
881 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { | 885 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { |
882 feature_flags_.chromium_screen_space_antialiasing = true; | 886 feature_flags_.chromium_screen_space_antialiasing = true; |
883 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); | 887 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); |
| 888 } else if (enable_cmaa_shaders_switch_ && |
| 889 (gl_version_info_->IsAtLeastGLES(3, 1) || |
| 890 (gl_version_info_->IsAtLeastGL(3, 0) && |
| 891 extensions.Contains("GL_ARB_shading_language_420pack") && |
| 892 extensions.Contains("GL_ARB_texture_gather") && |
| 893 extensions.Contains("GL_ARB_explicit_uniform_location") && |
| 894 extensions.Contains("GL_ARB_explicit_attrib_location") && |
| 895 extensions.Contains("GL_ARB_shader_image_load_store")))) { |
| 896 feature_flags_.chromium_screen_space_antialiasing = true; |
| 897 feature_flags_.use_chromium_screen_space_antialiasing_via_shaders = true; |
| 898 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); |
884 } | 899 } |
885 | 900 |
886 if (extensions.Contains("GL_OES_depth24") || gl::HasDesktopGLFeatures() || | 901 if (extensions.Contains("GL_OES_depth24") || gl::HasDesktopGLFeatures() || |
887 gl_version_info_->is_es3) { | 902 gl_version_info_->is_es3) { |
888 AddExtensionString("GL_OES_depth24"); | 903 AddExtensionString("GL_OES_depth24"); |
889 feature_flags_.oes_depth24 = true; | 904 feature_flags_.oes_depth24 = true; |
890 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); | 905 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); |
891 } | 906 } |
892 | 907 |
893 if (gl_version_info_->is_es3 || | 908 if (gl_version_info_->is_es3 || |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 if (pos == std::string::npos) { | 1408 if (pos == std::string::npos) { |
1394 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1409 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1395 } | 1410 } |
1396 } | 1411 } |
1397 | 1412 |
1398 FeatureInfo::~FeatureInfo() { | 1413 FeatureInfo::~FeatureInfo() { |
1399 } | 1414 } |
1400 | 1415 |
1401 } // namespace gles2 | 1416 } // namespace gles2 |
1402 } // namespace gpu | 1417 } // namespace gpu |
OLD | NEW |