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

Side by Side 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 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 10
(...skipping 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after
3403 GL_COLOR_ATTACHMENT0, 3403 GL_COLOR_ATTACHMENT0,
3404 kServiceTextureId, 4, 5)) 3404 kServiceTextureId, 4, 5))
3405 .Times(1) 3405 .Times(1)
3406 .RetiresOnSaturation(); 3406 .RetiresOnSaturation();
3407 cmds::FramebufferTextureLayer cmd; 3407 cmds::FramebufferTextureLayer cmd;
3408 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5); 3408 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5);
3409 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3409 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3410 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3410 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3411 } 3411 }
3412 3412
3413 TEST_P(GLES3DecoderTest, InvalidateFramebufferDepthStencilAttachment) {
3414 DoBindFramebuffer(
3415 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
3416 DoBindRenderbuffer(
3417 GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId);
3418 DoRenderbufferStorage(
3419 GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8,
3420 1, 1, GL_NO_ERROR);
3421 DoFramebufferRenderbuffer(
3422 GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
3423 client_renderbuffer_id_, kServiceRenderbufferId, GL_NO_ERROR);
3424
3425 Framebuffer* framebuffer =
3426 group().framebuffer_manager()->GetFramebuffer(client_framebuffer_id_);
3427 framebuffer->MarkAttachmentAsCleared(group().renderbuffer_manager(), nullptr,
3428 GL_DEPTH_STENCIL_ATTACHMENT, true);
3429 EXPECT_TRUE(framebuffer->IsCleared());
3430
3431 const GLenum target = GL_FRAMEBUFFER;
3432 const GLsizei count = 1;
3433 const GLenum attachments[] = {GL_DEPTH_ATTACHMENT};
3434 EXPECT_CALL(*gl_, InvalidateFramebuffer(target, 0, _))
3435 .Times(1)
3436 .RetiresOnSaturation();
3437 InvalidateFramebufferImmediate& cmd =
3438 *GetImmediateAs<InvalidateFramebufferImmediate>();
3439 cmd.Init(target, count, attachments);
3440
3441 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(attachments)));
3442 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3443 // Invalidating part of DEPTH_STENCIL attachment doesn't change framebuffer
3444 // clearance status.
3445 EXPECT_TRUE(framebuffer->IsCleared());
3446 EXPECT_FALSE(framebuffer->HasUnclearedAttachment(GL_DEPTH_ATTACHMENT));
3447 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.
3448 }
3449
3413 // TODO(gman): PixelStorei 3450 // TODO(gman): PixelStorei
3414 3451
3415 // TODO(gman): SwapBuffers 3452 // TODO(gman): SwapBuffers
3416 3453
3417 } // namespace gles2 3454 } // namespace gles2
3418 } // namespace gpu 3455 } // 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