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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2583183002: gles2: Fix glDiscardFramebufferEXT (Closed)
Patch Set: Provide a better implementation Created 4 years 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 <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 5941 matching lines...) Expand 10 before | Expand all | Expand 10 after
5952 } else { 5952 } else {
5953 if (!validators_->backbuffer_attachment.IsValid(attachment)) { 5953 if (!validators_->backbuffer_attachment.IsValid(attachment)) {
5954 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, attachment, 5954 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, attachment,
5955 "attachments"); 5955 "attachments");
5956 return; 5956 return;
5957 } 5957 }
5958 } 5958 }
5959 validated_attachments[validated_count++] = attachment; 5959 validated_attachments[validated_count++] = attachment;
5960 } 5960 }
5961 if (invalidate_depth && invalidate_stencil) { 5961 if (invalidate_depth && invalidate_stencil) {
5962 validated_attachments[validated_count++] = GL_DEPTH_STENCIL_ATTACHMENT; 5962 if (op != kFramebufferDiscard || gl_version_info().is_es3) {
5963 validated_attachments[validated_count++] = GL_DEPTH_STENCIL_ATTACHMENT;
5964 } else {
5965 // DEPTH_STENCIL is not a valid token for glDiscardFramebufferEXT
5966 validated_attachments[validated_count++] = GL_DEPTH_ATTACHMENT;
5967 validated_attachments[validated_count++] = GL_STENCIL_ATTACHMENT;
Zhenyao Mo 2016/12/19 17:53:48 It's easier to always split to DEPTH_ATTACHMENT an
jbriance 2016/12/19 19:40:45 Done in patch set 3
5968 }
5963 } 5969 }
5964 5970
5965 // If the default framebuffer is bound but we are still rendering to an 5971 // If the default framebuffer is bound but we are still rendering to an
5966 // FBO, translate attachment names that refer to default framebuffer 5972 // FBO, translate attachment names that refer to default framebuffer
5967 // channels to corresponding framebuffer attachments. 5973 // channels to corresponding framebuffer attachments.
5968 std::unique_ptr<GLenum[]> translated_attachments(new GLenum[validated_count]); 5974 std::unique_ptr<GLenum[]> translated_attachments(new GLenum[validated_count]);
5969 for (GLsizei i = 0; i < validated_count; ++i) { 5975 for (GLsizei i = 0; i < validated_count; ++i) {
5970 GLenum attachment = validated_attachments[i]; 5976 GLenum attachment = validated_attachments[i];
5971 if (!framebuffer && GetBackbufferServiceId()) { 5977 if (!framebuffer && GetBackbufferServiceId()) {
5972 switch (attachment) { 5978 switch (attachment) {
(...skipping 13022 matching lines...) Expand 10 before | Expand all | Expand 10 after
18995 } 19001 }
18996 19002
18997 // Include the auto-generated part of this file. We split this because it means 19003 // Include the auto-generated part of this file. We split this because it means
18998 // we can easily edit the non-auto generated parts right here in this file 19004 // we can easily edit the non-auto generated parts right here in this file
18999 // instead of having to edit some template or the code generator. 19005 // instead of having to edit some template or the code generator.
19000 #include "base/macros.h" 19006 #include "base/macros.h"
19001 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19007 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19002 19008
19003 } // namespace gles2 19009 } // namespace gles2
19004 } // namespace gpu 19010 } // 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