OLD | NEW |
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 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
8 | 8 |
9 // This file contains unit tests for gles2 commmands | 9 // This file contains unit tests for gles2 commmands |
10 // It is included by gles2_cmd_format_test.cc | 10 // It is included by gles2_cmd_format_test.cc |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 EXPECT_EQ(sizeof(cmd) + | 677 EXPECT_EQ(sizeof(cmd) + |
678 RoundSizeToMultipleOfEntries(cmd.n * 4u), | 678 RoundSizeToMultipleOfEntries(cmd.n * 4u), |
679 cmd.header.size * 4u); | 679 cmd.header.size * 4u); |
680 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); | 680 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); |
681 CheckBytesWrittenMatchesExpectedSize( | 681 CheckBytesWrittenMatchesExpectedSize( |
682 next_cmd, sizeof(cmd) + | 682 next_cmd, sizeof(cmd) + |
683 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); | 683 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); |
684 // TODO(gman): Check that ids were inserted; | 684 // TODO(gman): Check that ids were inserted; |
685 } | 685 } |
686 | 686 |
| 687 TEST_F(GLES2FormatTest, DeleteImageBuffers) { |
| 688 cmds::DeleteImageBuffers& cmd = *GetBufferAs<cmds::DeleteImageBuffers>(); |
| 689 void* next_cmd = cmd.Set( |
| 690 &cmd, |
| 691 static_cast<GLsizei>(11), |
| 692 static_cast<uint32>(12), |
| 693 static_cast<uint32>(13)); |
| 694 EXPECT_EQ(static_cast<uint32>(cmds::DeleteImageBuffers::kCmdId), |
| 695 cmd.header.command); |
| 696 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 697 EXPECT_EQ(static_cast<GLsizei>(11), cmd.n); |
| 698 EXPECT_EQ(static_cast<uint32>(12), cmd.imagebuffers_shm_id); |
| 699 EXPECT_EQ(static_cast<uint32>(13), cmd.imagebuffers_shm_offset); |
| 700 CheckBytesWrittenMatchesExpectedSize( |
| 701 next_cmd, sizeof(cmd)); |
| 702 } |
| 703 |
| 704 TEST_F(GLES2FormatTest, DeleteImageBuffersImmediate) { |
| 705 static GLuint ids[] = { 12, 23, 34, }; |
| 706 cmds::DeleteImageBuffersImmediate& cmd = |
| 707 *GetBufferAs<cmds::DeleteImageBuffersImmediate>(); |
| 708 void* next_cmd = cmd.Set( |
| 709 &cmd, static_cast<GLsizei>(arraysize(ids)), ids); |
| 710 EXPECT_EQ(static_cast<uint32>(cmds::DeleteImageBuffersImmediate::kCmdId), |
| 711 cmd.header.command); |
| 712 EXPECT_EQ(sizeof(cmd) + |
| 713 RoundSizeToMultipleOfEntries(cmd.n * 4u), |
| 714 cmd.header.size * 4u); |
| 715 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); |
| 716 CheckBytesWrittenMatchesExpectedSize( |
| 717 next_cmd, sizeof(cmd) + |
| 718 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); |
| 719 // TODO(gman): Check that ids were inserted; |
| 720 } |
| 721 |
687 TEST_F(GLES2FormatTest, DeleteProgram) { | 722 TEST_F(GLES2FormatTest, DeleteProgram) { |
688 cmds::DeleteProgram& cmd = *GetBufferAs<cmds::DeleteProgram>(); | 723 cmds::DeleteProgram& cmd = *GetBufferAs<cmds::DeleteProgram>(); |
689 void* next_cmd = cmd.Set( | 724 void* next_cmd = cmd.Set( |
690 &cmd, | 725 &cmd, |
691 static_cast<GLuint>(11)); | 726 static_cast<GLuint>(11)); |
692 EXPECT_EQ(static_cast<uint32>(cmds::DeleteProgram::kCmdId), | 727 EXPECT_EQ(static_cast<uint32>(cmds::DeleteProgram::kCmdId), |
693 cmd.header.command); | 728 cmd.header.command); |
694 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 729 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
695 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | 730 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); |
696 CheckBytesWrittenMatchesExpectedSize( | 731 CheckBytesWrittenMatchesExpectedSize( |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 EXPECT_EQ(sizeof(cmd) + | 1112 EXPECT_EQ(sizeof(cmd) + |
1078 RoundSizeToMultipleOfEntries(cmd.n * 4u), | 1113 RoundSizeToMultipleOfEntries(cmd.n * 4u), |
1079 cmd.header.size * 4u); | 1114 cmd.header.size * 4u); |
1080 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); | 1115 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); |
1081 CheckBytesWrittenMatchesExpectedSize( | 1116 CheckBytesWrittenMatchesExpectedSize( |
1082 next_cmd, sizeof(cmd) + | 1117 next_cmd, sizeof(cmd) + |
1083 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); | 1118 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); |
1084 // TODO(gman): Check that ids were inserted; | 1119 // TODO(gman): Check that ids were inserted; |
1085 } | 1120 } |
1086 | 1121 |
| 1122 TEST_F(GLES2FormatTest, GenImageBuffers) { |
| 1123 cmds::GenImageBuffers& cmd = *GetBufferAs<cmds::GenImageBuffers>(); |
| 1124 void* next_cmd = cmd.Set( |
| 1125 &cmd, |
| 1126 static_cast<GLsizei>(11), |
| 1127 static_cast<uint32>(12), |
| 1128 static_cast<uint32>(13)); |
| 1129 EXPECT_EQ(static_cast<uint32>(cmds::GenImageBuffers::kCmdId), |
| 1130 cmd.header.command); |
| 1131 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 1132 EXPECT_EQ(static_cast<GLsizei>(11), cmd.n); |
| 1133 EXPECT_EQ(static_cast<uint32>(12), cmd.imagebuffers_shm_id); |
| 1134 EXPECT_EQ(static_cast<uint32>(13), cmd.imagebuffers_shm_offset); |
| 1135 CheckBytesWrittenMatchesExpectedSize( |
| 1136 next_cmd, sizeof(cmd)); |
| 1137 } |
| 1138 |
| 1139 TEST_F(GLES2FormatTest, GenImageBuffersImmediate) { |
| 1140 static GLuint ids[] = { 12, 23, 34, }; |
| 1141 cmds::GenImageBuffersImmediate& cmd = |
| 1142 *GetBufferAs<cmds::GenImageBuffersImmediate>(); |
| 1143 void* next_cmd = cmd.Set( |
| 1144 &cmd, static_cast<GLsizei>(arraysize(ids)), ids); |
| 1145 EXPECT_EQ(static_cast<uint32>(cmds::GenImageBuffersImmediate::kCmdId), |
| 1146 cmd.header.command); |
| 1147 EXPECT_EQ(sizeof(cmd) + |
| 1148 RoundSizeToMultipleOfEntries(cmd.n * 4u), |
| 1149 cmd.header.size * 4u); |
| 1150 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); |
| 1151 CheckBytesWrittenMatchesExpectedSize( |
| 1152 next_cmd, sizeof(cmd) + |
| 1153 RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); |
| 1154 // TODO(gman): Check that ids were inserted; |
| 1155 } |
| 1156 |
1087 TEST_F(GLES2FormatTest, GenRenderbuffers) { | 1157 TEST_F(GLES2FormatTest, GenRenderbuffers) { |
1088 cmds::GenRenderbuffers& cmd = *GetBufferAs<cmds::GenRenderbuffers>(); | 1158 cmds::GenRenderbuffers& cmd = *GetBufferAs<cmds::GenRenderbuffers>(); |
1089 void* next_cmd = cmd.Set( | 1159 void* next_cmd = cmd.Set( |
1090 &cmd, | 1160 &cmd, |
1091 static_cast<GLsizei>(11), | 1161 static_cast<GLsizei>(11), |
1092 static_cast<uint32>(12), | 1162 static_cast<uint32>(12), |
1093 static_cast<uint32>(13)); | 1163 static_cast<uint32>(13)); |
1094 EXPECT_EQ(static_cast<uint32>(cmds::GenRenderbuffers::kCmdId), | 1164 EXPECT_EQ(static_cast<uint32>(cmds::GenRenderbuffers::kCmdId), |
1095 cmd.header.command); | 1165 cmd.header.command); |
1096 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 1166 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4495 EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u); | 4565 EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u); |
4496 EXPECT_EQ(static_cast<GLsizei>(1), cmd.count); | 4566 EXPECT_EQ(static_cast<GLsizei>(1), cmd.count); |
4497 CheckBytesWrittenMatchesExpectedSize( | 4567 CheckBytesWrittenMatchesExpectedSize( |
4498 next_cmd, sizeof(cmd) + | 4568 next_cmd, sizeof(cmd) + |
4499 RoundSizeToMultipleOfEntries(sizeof(data))); | 4569 RoundSizeToMultipleOfEntries(sizeof(data))); |
4500 // TODO(gman): Check that data was inserted; | 4570 // TODO(gman): Check that data was inserted; |
4501 } | 4571 } |
4502 | 4572 |
4503 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ | 4573 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ |
4504 | 4574 |
OLD | NEW |