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

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

Issue 2166923002: Add unittests for InvalidateFramebuffer with DEPTH_STENCIL_ATTACHMENT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bots failures Created 4 years, 5 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
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..6cf750299360a86117417d60cd3034405c6964a0 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 make DEPTH and STENCIL
Ken Russell (switch to Gerrit) 2016/07/22 18:24:31 Typo? make -> mark?
qiankun 2016/07/22 19:15:06 Done.
+ // 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(),

Powered by Google App Engine
This is Rietveld 408576698