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

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

Issue 2055713003: gpu: Implement GL_INTEL_framebuffer_CMAA via shaders in the GPU Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 6 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 <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
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
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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 extensions.Contains("GL_EXT_multisample_compatibility")) { 877 extensions.Contains("GL_EXT_multisample_compatibility")) {
874 AddExtensionString("GL_EXT_multisample_compatibility"); 878 AddExtensionString("GL_EXT_multisample_compatibility");
875 feature_flags_.ext_multisample_compatibility = true; 879 feature_flags_.ext_multisample_compatibility = true;
876 validators_.capability.AddValue(GL_MULTISAMPLE_EXT); 880 validators_.capability.AddValue(GL_MULTISAMPLE_EXT);
877 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT); 881 validators_.capability.AddValue(GL_SAMPLE_ALPHA_TO_ONE_EXT);
878 } 882 }
879 883
880 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) { 884 if (extensions.Contains("GL_INTEL_framebuffer_CMAA")) {
881 feature_flags_.chromium_screen_space_antialiasing = true; 885 feature_flags_.chromium_screen_space_antialiasing = true;
882 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing"); 886 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing");
887 } else if (enable_cmaa_shaders_switch_ &&
888 (gl_version_info_->IsAtLeastGLES(3, 1) ||
889 (gl_version_info_->IsAtLeastGL(3, 0) &&
890 extensions.Contains("GL_ARB_shading_language_420pack") &&
891 extensions.Contains("GL_ARB_texture_gather") &&
892 extensions.Contains("GL_ARB_explicit_uniform_location") &&
893 extensions.Contains("GL_ARB_explicit_attrib_location") &&
894 extensions.Contains("GL_ARB_shader_image_load_store")))) {
895 feature_flags_.chromium_screen_space_antialiasing = true;
896 feature_flags_.use_chromium_screen_space_antialiasing_via_shaders = true;
897 AddExtensionString("GL_CHROMIUM_screen_space_antialiasing");
883 } 898 }
884 899
885 if (extensions.Contains("GL_OES_depth24") || gl::HasDesktopGLFeatures() || 900 if (extensions.Contains("GL_OES_depth24") || gl::HasDesktopGLFeatures() ||
886 gl_version_info_->is_es3) { 901 gl_version_info_->is_es3) {
887 AddExtensionString("GL_OES_depth24"); 902 AddExtensionString("GL_OES_depth24");
888 feature_flags_.oes_depth24 = true; 903 feature_flags_.oes_depth24 = true;
889 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); 904 validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24);
890 } 905 }
891 906
892 if (gl_version_info_->is_es3 || 907 if (gl_version_info_->is_es3 ||
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 if (pos == std::string::npos) { 1409 if (pos == std::string::npos) {
1395 extensions_ += (extensions_.empty() ? "" : " ") + str; 1410 extensions_ += (extensions_.empty() ? "" : " ") + str;
1396 } 1411 }
1397 } 1412 }
1398 1413
1399 FeatureInfo::~FeatureInfo() { 1414 FeatureInfo::~FeatureInfo() {
1400 } 1415 }
1401 1416
1402 } // namespace gles2 1417 } // namespace gles2
1403 } // namespace gpu 1418 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698