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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 9351 matching lines...) Expand 10 before | Expand all | Expand 10 after
9362 offscreen_saved_color_format_); 9362 offscreen_saved_color_format_);
9363 } else { 9363 } else {
9364 // Flip the textures in the parent context via the texture manager. 9364 // Flip the textures in the parent context via the texture manager.
9365 if (!!offscreen_saved_color_texture_info_.get()) 9365 if (!!offscreen_saved_color_texture_info_.get())
9366 offscreen_saved_color_texture_info_->texture()-> 9366 offscreen_saved_color_texture_info_->texture()->
9367 SetServiceId(offscreen_target_color_texture_->id()); 9367 SetServiceId(offscreen_target_color_texture_->id());
9368 9368
9369 offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); 9369 offscreen_saved_color_texture_.swap(offscreen_target_color_texture_);
9370 offscreen_target_frame_buffer_->AttachRenderTexture( 9370 offscreen_target_frame_buffer_->AttachRenderTexture(
9371 offscreen_target_color_texture_.get()); 9371 offscreen_target_color_texture_.get());
9372
9373 // Explicitly discard framebuffer to save GPU memory bandwidth for
9374 // tile-based GPU arch.
9375 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
9376 const GLenum attachments[3] = {
9377 GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
9378 glDiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments);
9379 }
9372 } 9380 }
9373 9381
9374 // Ensure the side effects of the copy are visible to the parent 9382 // Ensure the side effects of the copy are visible to the parent
9375 // context. There is no need to do this for ANGLE because it uses a 9383 // context. There is no need to do this for ANGLE because it uses a
9376 // single D3D device for all contexts. 9384 // single D3D device for all contexts.
9377 if (!feature_info_->feature_flags().is_angle) 9385 if (!feature_info_->feature_flags().is_angle)
9378 glFlush(); 9386 glFlush();
9379 } 9387 }
9380 } else { 9388 } else {
9381 if (!surface_->SwapBuffers()) { 9389 if (!surface_->SwapBuffers()) {
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after
11145 } 11153 }
11146 } 11154 }
11147 11155
11148 // Include the auto-generated part of this file. We split this because it means 11156 // Include the auto-generated part of this file. We split this because it means
11149 // we can easily edit the non-auto generated parts right here in this file 11157 // we can easily edit the non-auto generated parts right here in this file
11150 // instead of having to edit some template or the code generator. 11158 // instead of having to edit some template or the code generator.
11151 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 11159 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
11152 11160
11153 } // namespace gles2 11161 } // namespace gles2
11154 } // namespace gpu 11162 } // namespace gpu
OLDNEW
« 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