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

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: update tests 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/context_group.cc ('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 a8d5a8e3ccfccdc902b0431bc18f2b24506ebc52..a8b497fd6f5ad735068aab7e5f119b932894f3d7 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1155,14 +1155,17 @@ void FeatureInfo::InitializeFeatures() {
validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
}
- bool vendor_agnostic_draw_buffers =
+ bool have_es2_draw_buffers_vendor_agnostic =
+ gl_version_info_->is_desktop_core_profile ||
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 can_emulate_es2_draw_buffers_on_es3_nv =
+ gl_version_info_->is_es3 && extensions.Contains("GL_NV_draw_buffers");
+ bool have_es2_draw_buffers = !workarounds_.disable_ext_draw_buffers &&
+ IsWebGL1OrES2Context() &&
+ (have_es2_draw_buffers_vendor_agnostic ||
+ can_emulate_es2_draw_buffers_on_es3_nv);
Zhenyao Mo 2017/02/17 19:17:44 This is neat, much more readable
+ if (have_es2_draw_buffers) {
AddExtensionString("GL_EXT_draw_buffers");
feature_flags_.ext_draw_buffers = true;
@@ -1174,8 +1177,11 @@ void FeatureInfo::InitializeFeatures() {
// 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;
+ feature_flags_.nv_draw_buffers = can_emulate_es2_draw_buffers_on_es3_nv &&
+ !have_es2_draw_buffers_vendor_agnostic;
+ }
+ if (IsWebGL2OrES3Context() || have_es2_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/context_group.cc ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698