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

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

Issue 2166923002: Add unittests for InvalidateFramebuffer with DEPTH_STENCIL_ATTACHMENT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check glInvalidateFramebuffer 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
« 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_unittest_framebuffers.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
index dda301aeb5c2c342a0036ad715e7d80a4963a7a7..de37cc0fea5b86d6033af8d65a2df426a172fd07 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -3410,6 +3410,43 @@ TEST_P(GLES3DecoderTest, FramebufferTextureLayerValidArgs) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+TEST_P(GLES3DecoderTest, InvalidateFramebufferDepthStencilAttachment) {
+ DoBindFramebuffer(
+ GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
+ DoBindRenderbuffer(
+ GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
+ DoRenderbufferStorage(
+ GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8,
+ 1, 1, GL_NO_ERROR);
+ DoFramebufferRenderbuffer(
+ GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
+ client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
+
+ Framebuffer* framebuffer =
+ group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_);
+ framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr,
+ GL_DEPTH_STENCIL_ATTACHMENT, true);
+ EXPECT_TRUE(framebuffer->IsCleared());
+
+ const GLenum target = GL_FRAMEBUFFER;
+ const GLsizei count = 1;
+ const GLenum attachments[] = {GL_DEPTH_ATTACHMENT};
+ EXPECT_CALL(*gl_, InvalidateFramebuffer(target, 0, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ InvalidateFramebufferImmediate& cmd =
+ *GetImmediateAs<InvalidateFramebufferImmediate>();
+ cmd.Init(target, count, attachments);
+
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(attachments)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ // Invalidating part of DEPTH_STENCIL attachment doesn't change framebuffer
+ // clearance status.
+ EXPECT_TRUE(framebuffer->IsCleared());
+ EXPECT_FALSE(framebuffer->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT));
+ EXPECT_FALSE(framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT));
Ken Russell (switch to Gerrit) 2016/07/20 23:44:08 Could you add a subsequent test which invalidates
qiankun 2016/07/22 17:56:40 Done.
+}
+
// TODO(gman): PixelStorei
// TODO(gman): SwapBuffers
« 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