| 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 0bcdbd4a006d35702d96d3a24c7d114161ae144d..4bbbc4c0d0b92b4622339668548e3f88a25f50d9 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -5687,8 +5687,7 @@ void GLES2DecoderImpl::InvalidateFramebufferImpl(
|
| // Because of performance issues, no-op if the format of the attachment is
|
| // DEPTH_STENCIL and only one part is intended to be invalidated.
|
| bool has_depth_stencil_format = framebuffer &&
|
| - framebuffer->HasDepthStencilFormatAttachment(GL_DEPTH_ATTACHMENT) &&
|
| - framebuffer->HasDepthStencilFormatAttachment(GL_STENCIL_ATTACHMENT);
|
| + framebuffer->HasDepthStencilFormatAttachment();
|
| bool invalidate_depth = false;
|
| bool invalidate_stencil = false;
|
| std::unique_ptr<GLenum[]> validated_attachments(new GLenum[count]);
|
| @@ -5717,6 +5716,10 @@ void GLES2DecoderImpl::InvalidateFramebufferImpl(
|
| case GL_STENCIL_ATTACHMENT:
|
| invalidate_stencil = true;
|
| continue;
|
| + case GL_DEPTH_STENCIL_ATTACHMENT:
|
| + invalidate_depth = true;
|
| + invalidate_stencil = true;
|
| + continue;
|
| }
|
| }
|
| } else {
|
| @@ -5792,6 +5795,9 @@ void GLES2DecoderImpl::InvalidateFramebufferImpl(
|
| for (GLsizei i = 0; i < validated_count; ++i) {
|
| if (framebuffer) {
|
| if (validated_attachments[i] == GL_DEPTH_STENCIL_ATTACHMENT) {
|
| + // TODO(qiankun.miao@intel.com): We should only mark DEPTH and STENCIL
|
| + // attachments as cleared when command buffer handles DEPTH_STENCIL
|
| + // well. http://crbug.com/630568
|
| framebuffer->MarkAttachmentAsCleared(renderbuffer_manager(),
|
| texture_manager(),
|
| GL_DEPTH_ATTACHMENT,
|
| @@ -5800,6 +5806,10 @@ void GLES2DecoderImpl::InvalidateFramebufferImpl(
|
| texture_manager(),
|
| GL_STENCIL_ATTACHMENT,
|
| false);
|
| + framebuffer->MarkAttachmentAsCleared(renderbuffer_manager(),
|
| + texture_manager(),
|
| + GL_DEPTH_STENCIL_ATTACHMENT,
|
| + false);
|
| } else {
|
| framebuffer->MarkAttachmentAsCleared(renderbuffer_manager(),
|
| texture_manager(),
|
|
|