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

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

Issue 651863002: Use glDiscardFramebuffer to save memory bandwidth in PNaCl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c55d9e387b11b81eb2f4448a4670fde2cade8a66..8c38e8a0765ac275a321b29005c2d7dffa5583e4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9369,6 +9369,14 @@ void GLES2DecoderImpl::DoSwapBuffers() {
offscreen_saved_color_texture_.swap(offscreen_target_color_texture_);
offscreen_target_frame_buffer_->AttachRenderTexture(
offscreen_target_color_texture_.get());
+
+ // Explicitly discard framebuffer to save GPU memory bandwidth for
+ // tile-based GPU arch.
+ if (feature_info_->feature_flags().ext_discard_framebuffer) {
Hongbo Min 2014/10/14 02:27:48 According to my previous work, an attempt to clear
dshwang 2014/10/14 12:09:30 As far as I understand, your CL didn't affect whet
+ const GLenum attachments[3] = {
+ GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
+ glDiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments);
+ }
}
// Ensure the side effects of the copy are visible to the parent
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698