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

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

Issue 640283003: Use NV_draw_buffers to implement EXT_draw_buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Added explanation of nv_draw_buffers flag to feature_info.cc Created 6 years, 2 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 e853d9b59387fac65e910d0ca3fb0cdba2fcf157..0274132359a78868ebbefa41534f06752179582e 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -132,6 +132,7 @@ FeatureInfo::FeatureFlags::FeatureFlags()
enable_shader_name_hashing(false),
enable_samplers(false),
ext_draw_buffers(false),
+ nv_draw_buffers(false),
ext_frag_depth(false),
ext_shader_texture_lod(false),
use_async_readpixels(false),
@@ -760,12 +761,25 @@ 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 &&
- (extensions.Contains("GL_ARB_draw_buffers") ||
- extensions.Contains("GL_EXT_draw_buffers"))) {
+ (vendor_agnostic_draw_buffers ||
+ (extensions.Contains("GL_NV_draw_buffers") && is_es3))) {
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;
+
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