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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 2461003003: Reduce GPU mailbox size to 16 bytes (Closed)
Patch Set: fix tests Created 4 years, 1 month 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
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 // Tests for GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after
3714 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3714 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3715 // Check it's cached and not called again. 3715 // Check it's cached and not called again.
3716 ClearCommands(); 3716 ClearCommands();
3717 gl_->Enable(GL_BLEND); 3717 gl_->Enable(GL_BLEND);
3718 EXPECT_TRUE(NoCommandsWritten()); 3718 EXPECT_TRUE(NoCommandsWritten());
3719 } 3719 }
3720 3720
3721 TEST_F(GLES2ImplementationTest, ConsumeTextureCHROMIUM) { 3721 TEST_F(GLES2ImplementationTest, ConsumeTextureCHROMIUM) {
3722 struct Cmds { 3722 struct Cmds {
3723 cmds::ConsumeTextureCHROMIUMImmediate cmd; 3723 cmds::ConsumeTextureCHROMIUMImmediate cmd;
3724 GLbyte data[64]; 3724 GLbyte data[GL_MAILBOX_SIZE_CHROMIUM];
3725 }; 3725 };
3726 3726
3727 Mailbox mailbox = Mailbox::Generate(); 3727 Mailbox mailbox = Mailbox::Generate();
3728 Cmds expected; 3728 Cmds expected;
3729 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); 3729 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name);
3730 gl_->ConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 3730 gl_->ConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
3731 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3731 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3732 } 3732 }
3733 3733
3734 TEST_F(GLES2ImplementationTest, CreateAndConsumeTextureCHROMIUM) { 3734 TEST_F(GLES2ImplementationTest, CreateAndConsumeTextureCHROMIUM) {
3735 struct Cmds { 3735 struct Cmds {
3736 cmds::CreateAndConsumeTextureINTERNALImmediate cmd; 3736 cmds::CreateAndConsumeTextureINTERNALImmediate cmd;
3737 GLbyte data[64]; 3737 GLbyte data[GL_MAILBOX_SIZE_CHROMIUM];
3738 }; 3738 };
3739 3739
3740 Mailbox mailbox = Mailbox::Generate(); 3740 Mailbox mailbox = Mailbox::Generate();
3741 Cmds expected; 3741 Cmds expected;
3742 expected.cmd.Init(GL_TEXTURE_2D, kTexturesStartId, mailbox.name); 3742 expected.cmd.Init(GL_TEXTURE_2D, kTexturesStartId, mailbox.name);
3743 GLuint id = gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 3743 GLuint id = gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
3744 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3744 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3745 EXPECT_EQ(kTexturesStartId, id); 3745 EXPECT_EQ(kTexturesStartId, id);
3746 } 3746 }
3747 3747
3748 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) { 3748 TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) {
3749 struct Cmds { 3749 struct Cmds {
3750 cmds::ProduceTextureCHROMIUMImmediate cmd; 3750 cmds::ProduceTextureCHROMIUMImmediate cmd;
3751 GLbyte data[64]; 3751 GLbyte data[GL_MAILBOX_SIZE_CHROMIUM];
3752 }; 3752 };
3753 3753
3754 Mailbox mailbox = Mailbox::Generate(); 3754 Mailbox mailbox = Mailbox::Generate();
3755 Cmds expected; 3755 Cmds expected;
3756 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name); 3756 expected.cmd.Init(GL_TEXTURE_2D, mailbox.name);
3757 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 3757 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
3758 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3758 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3759 } 3759 }
3760 3760
3761 TEST_F(GLES2ImplementationTest, ProduceTextureDirectCHROMIUM) { 3761 TEST_F(GLES2ImplementationTest, ProduceTextureDirectCHROMIUM) {
3762 struct Cmds { 3762 struct Cmds {
3763 cmds::ProduceTextureDirectCHROMIUMImmediate cmd; 3763 cmds::ProduceTextureDirectCHROMIUMImmediate cmd;
3764 GLbyte data[64]; 3764 GLbyte data[GL_MAILBOX_SIZE_CHROMIUM];
3765 }; 3765 };
3766 3766
3767 Mailbox mailbox = Mailbox::Generate(); 3767 Mailbox mailbox = Mailbox::Generate();
3768 Cmds expected; 3768 Cmds expected;
3769 expected.cmd.Init(kTexturesStartId, GL_TEXTURE_2D, mailbox.name); 3769 expected.cmd.Init(kTexturesStartId, GL_TEXTURE_2D, mailbox.name);
3770 gl_->ProduceTextureDirectCHROMIUM( 3770 gl_->ProduceTextureDirectCHROMIUM(
3771 kTexturesStartId, GL_TEXTURE_2D, mailbox.name); 3771 kTexturesStartId, GL_TEXTURE_2D, mailbox.name);
3772 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3772 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3773 } 3773 }
3774 3774
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
4660 ContextInitOptions init_options; 4660 ContextInitOptions init_options;
4661 init_options.transfer_buffer_initialize_fail = true; 4661 init_options.transfer_buffer_initialize_fail = true;
4662 EXPECT_FALSE(Initialize(init_options)); 4662 EXPECT_FALSE(Initialize(init_options));
4663 } 4663 }
4664 4664
4665 #include "base/macros.h" 4665 #include "base/macros.h"
4666 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 4666 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
4667 4667
4668 } // namespace gles2 4668 } // namespace gles2
4669 } // namespace gpu 4669 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/common/gles2_cmd_format_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698