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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 2678483003: Fix EXT_draw_buffers detection on some GL ES 3 contexts (Closed)
Patch Set: remove nv_draw_buffers entirely Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index a4acdd15c4927e7548fe0e35fc3e52f1aed62aa5..d01604bc14b4d8d27e6ce4ca1211f11e47c12479 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1152,27 +1152,18 @@ void FeatureInfo::InitializeFeatures() {
validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
}
- bool vendor_agnostic_draw_buffers =
- extensions.Contains("GL_ARB_draw_buffers") ||
- extensions.Contains("GL_EXT_draw_buffers");
- if (!workarounds_.disable_ext_draw_buffers &&
- (vendor_agnostic_draw_buffers ||
- (extensions.Contains("GL_NV_draw_buffers") &&
- gl_version_info_->is_es3) ||
- gl_version_info_->is_desktop_core_profile)) {
+ bool support_draw_buffers = extensions.Contains("GL_ARB_draw_buffers") ||
+ extensions.Contains("GL_EXT_draw_buffers") ||
+ gl_version_info_->is_es3 ||
Zhenyao Mo 2017/02/15 18:42:37 nit: probably put the last two conditions first as
+ gl_version_info_->is_desktop_core_profile;
+ bool have_draw_buffers = !workarounds_.disable_ext_draw_buffers &&
+ IsWebGL1OrES2Context() && support_draw_buffers;
+ if (have_draw_buffers) {
AddExtensionString("GL_EXT_draw_buffers");
feature_flags_.ext_draw_buffers = true;
+ }
- // This flag is set to enable emulation of EXT_draw_buffers when we're
- // running on GLES 3.0+, NV_draw_buffers extension is supported and
- // glDrawBuffers from GLES 3.0 core has been bound. It toggles using the
- // NV_draw_buffers extension directive instead of EXT_draw_buffers extension
- // directive in ESSL 100 shaders translated by ANGLE, enabling them to write
- // into multiple gl_FragData values, which is not by default possible in
- // ESSL 100 with core GLES 3.0. For more information, see the
- // NV_draw_buffers specification.
- feature_flags_.nv_draw_buffers = !vendor_agnostic_draw_buffers;
-
+ if (IsWebGL2OrES3Context() || have_draw_buffers) {
GLint max_color_attachments = 0;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments);
for (GLenum i = GL_COLOR_ATTACHMENT1_EXT;
« 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