OLD | NEW |
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 // 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 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 }; | 202 }; |
203 Cmds expected; | 203 Cmds expected; |
204 expected.cmd.Init(1); | 204 expected.cmd.Init(1); |
205 | 205 |
206 gl_->CompileShader(1); | 206 gl_->CompileShader(1); |
207 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 207 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
208 } | 208 } |
209 // TODO: Implement unit test for CompressedTexImage2D | 209 // TODO: Implement unit test for CompressedTexImage2D |
210 // TODO: Implement unit test for CompressedTexSubImage2D | 210 // TODO: Implement unit test for CompressedTexSubImage2D |
211 | 211 |
| 212 TEST_F(GLES2ImplementationTest, CopyBufferSubData) { |
| 213 struct Cmds { |
| 214 cmds::CopyBufferSubData cmd; |
| 215 }; |
| 216 Cmds expected; |
| 217 expected.cmd.Init(GL_ARRAY_BUFFER, GL_ARRAY_BUFFER, 3, 4, 5); |
| 218 |
| 219 gl_->CopyBufferSubData(GL_ARRAY_BUFFER, GL_ARRAY_BUFFER, 3, 4, 5); |
| 220 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 221 } |
| 222 |
212 TEST_F(GLES2ImplementationTest, CopyTexImage2D) { | 223 TEST_F(GLES2ImplementationTest, CopyTexImage2D) { |
213 struct Cmds { | 224 struct Cmds { |
214 cmds::CopyTexImage2D cmd; | 225 cmds::CopyTexImage2D cmd; |
215 }; | 226 }; |
216 Cmds expected; | 227 Cmds expected; |
217 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_ALPHA, 4, 5, 6, 7); | 228 expected.cmd.Init(GL_TEXTURE_2D, 2, GL_ALPHA, 4, 5, 6, 7); |
218 | 229 |
219 gl_->CopyTexImage2D(GL_TEXTURE_2D, 2, GL_ALPHA, 4, 5, 6, 7, 0); | 230 gl_->CopyTexImage2D(GL_TEXTURE_2D, 2, GL_ALPHA, 4, 5, 6, 7, 0); |
220 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 231 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
221 } | 232 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 449 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
439 } | 450 } |
440 | 451 |
441 TEST_F(GLES2ImplementationTest, FramebufferTexture2DInvalidConstantArg4) { | 452 TEST_F(GLES2ImplementationTest, FramebufferTexture2DInvalidConstantArg4) { |
442 gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, | 453 gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
443 4, 1); | 454 4, 1); |
444 EXPECT_TRUE(NoCommandsWritten()); | 455 EXPECT_TRUE(NoCommandsWritten()); |
445 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 456 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
446 } | 457 } |
447 | 458 |
| 459 TEST_F(GLES2ImplementationTest, FramebufferTextureLayer) { |
| 460 struct Cmds { |
| 461 cmds::FramebufferTextureLayer cmd; |
| 462 }; |
| 463 Cmds expected; |
| 464 expected.cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 3, 4, 5); |
| 465 |
| 466 gl_->FramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 3, 4, 5); |
| 467 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 468 } |
| 469 |
448 TEST_F(GLES2ImplementationTest, FrontFace) { | 470 TEST_F(GLES2ImplementationTest, FrontFace) { |
449 struct Cmds { | 471 struct Cmds { |
450 cmds::FrontFace cmd; | 472 cmds::FrontFace cmd; |
451 }; | 473 }; |
452 Cmds expected; | 474 Cmds expected; |
453 expected.cmd.Init(GL_CW); | 475 expected.cmd.Init(GL_CW); |
454 | 476 |
455 gl_->FrontFace(GL_CW); | 477 gl_->FrontFace(GL_CW); |
456 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 478 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
457 } | 479 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 647 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
626 expected.cmd.Init(123, result1.id, result1.offset); | 648 expected.cmd.Init(123, result1.id, result1.offset); |
627 EXPECT_CALL(*command_buffer(), OnFlush()) | 649 EXPECT_CALL(*command_buffer(), OnFlush()) |
628 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 650 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
629 .RetiresOnSaturation(); | 651 .RetiresOnSaturation(); |
630 gl_->GetIntegerv(123, &result); | 652 gl_->GetIntegerv(123, &result); |
631 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 653 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
632 EXPECT_EQ(static_cast<Result::Type>(1), result); | 654 EXPECT_EQ(static_cast<Result::Type>(1), result); |
633 } | 655 } |
634 | 656 |
| 657 TEST_F(GLES2ImplementationTest, GetInternalformativ) { |
| 658 struct Cmds { |
| 659 cmds::GetInternalformativ cmd; |
| 660 }; |
| 661 typedef cmds::GetInternalformativ::Result Result; |
| 662 Result::Type result = 0; |
| 663 Cmds expected; |
| 664 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 665 expected.cmd.Init(123, GL_RGBA4, GL_RENDERBUFFER_RED_SIZE, 4, result1.id, |
| 666 result1.offset); |
| 667 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 668 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 669 .RetiresOnSaturation(); |
| 670 gl_->GetInternalformativ(123, GL_RGBA4, GL_RENDERBUFFER_RED_SIZE, 4, &result); |
| 671 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 672 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 673 } |
| 674 |
635 TEST_F(GLES2ImplementationTest, GetProgramiv) { | 675 TEST_F(GLES2ImplementationTest, GetProgramiv) { |
636 struct Cmds { | 676 struct Cmds { |
637 cmds::GetProgramiv cmd; | 677 cmds::GetProgramiv cmd; |
638 }; | 678 }; |
639 typedef cmds::GetProgramiv::Result Result; | 679 typedef cmds::GetProgramiv::Result Result; |
640 Result::Type result = 0; | 680 Result::Type result = 0; |
641 Cmds expected; | 681 Cmds expected; |
642 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 682 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
643 expected.cmd.Init(123, GL_DELETE_STATUS, result1.id, result1.offset); | 683 expected.cmd.Init(123, GL_DELETE_STATUS, result1.id, result1.offset); |
644 EXPECT_CALL(*command_buffer(), OnFlush()) | 684 EXPECT_CALL(*command_buffer(), OnFlush()) |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 | 1144 |
1105 for (int jj = 0; jj < 1; ++jj) { | 1145 for (int jj = 0; jj < 1; ++jj) { |
1106 data[jj] = static_cast<GLint>(jj); | 1146 data[jj] = static_cast<GLint>(jj); |
1107 } | 1147 } |
1108 Cmds expected; | 1148 Cmds expected; |
1109 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]); | 1149 expected.cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]); |
1110 gl_->TexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]); | 1150 gl_->TexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &data[0]); |
1111 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1151 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1112 } | 1152 } |
1113 | 1153 |
| 1154 TEST_F(GLES2ImplementationTest, TexStorage3D) { |
| 1155 struct Cmds { |
| 1156 cmds::TexStorage3D cmd; |
| 1157 }; |
| 1158 Cmds expected; |
| 1159 expected.cmd.Init(GL_TEXTURE_3D, 2, GL_RGB565, 4, 5, 6); |
| 1160 |
| 1161 gl_->TexStorage3D(GL_TEXTURE_3D, 2, GL_RGB565, 4, 5, 6); |
| 1162 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1163 } |
| 1164 |
1114 TEST_F(GLES2ImplementationTest, Uniform1f) { | 1165 TEST_F(GLES2ImplementationTest, Uniform1f) { |
1115 struct Cmds { | 1166 struct Cmds { |
1116 cmds::Uniform1f cmd; | 1167 cmds::Uniform1f cmd; |
1117 }; | 1168 }; |
1118 Cmds expected; | 1169 Cmds expected; |
1119 expected.cmd.Init(1, 2); | 1170 expected.cmd.Init(1, 2); |
1120 | 1171 |
1121 gl_->Uniform1f(1, 2); | 1172 gl_->Uniform1f(1, 2); |
1122 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1173 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1123 } | 1174 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 for (int ii = 0; ii < 2; ++ii) { | 1213 for (int ii = 0; ii < 2; ++ii) { |
1163 for (int jj = 0; jj < 1; ++jj) { | 1214 for (int jj = 0; jj < 1; ++jj) { |
1164 data[ii][jj] = static_cast<GLint>(ii * 1 + jj); | 1215 data[ii][jj] = static_cast<GLint>(ii * 1 + jj); |
1165 } | 1216 } |
1166 } | 1217 } |
1167 expected.cmd.Init(1, 2, &data[0][0]); | 1218 expected.cmd.Init(1, 2, &data[0][0]); |
1168 gl_->Uniform1iv(1, 2, &data[0][0]); | 1219 gl_->Uniform1iv(1, 2, &data[0][0]); |
1169 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1220 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1170 } | 1221 } |
1171 | 1222 |
| 1223 TEST_F(GLES2ImplementationTest, Uniform1ui) { |
| 1224 struct Cmds { |
| 1225 cmds::Uniform1ui cmd; |
| 1226 }; |
| 1227 Cmds expected; |
| 1228 expected.cmd.Init(1, 2); |
| 1229 |
| 1230 gl_->Uniform1ui(1, 2); |
| 1231 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1232 } |
| 1233 |
| 1234 TEST_F(GLES2ImplementationTest, Uniform1uiv) { |
| 1235 GLuint data[2][1] = {{0}}; |
| 1236 struct Cmds { |
| 1237 cmds::Uniform1uivImmediate cmd; |
| 1238 GLuint data[2][1]; |
| 1239 }; |
| 1240 |
| 1241 Cmds expected; |
| 1242 for (int ii = 0; ii < 2; ++ii) { |
| 1243 for (int jj = 0; jj < 1; ++jj) { |
| 1244 data[ii][jj] = static_cast<GLuint>(ii * 1 + jj); |
| 1245 } |
| 1246 } |
| 1247 expected.cmd.Init(1, 2, &data[0][0]); |
| 1248 gl_->Uniform1uiv(1, 2, &data[0][0]); |
| 1249 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1250 } |
| 1251 |
1172 TEST_F(GLES2ImplementationTest, Uniform2f) { | 1252 TEST_F(GLES2ImplementationTest, Uniform2f) { |
1173 struct Cmds { | 1253 struct Cmds { |
1174 cmds::Uniform2f cmd; | 1254 cmds::Uniform2f cmd; |
1175 }; | 1255 }; |
1176 Cmds expected; | 1256 Cmds expected; |
1177 expected.cmd.Init(1, 2, 3); | 1257 expected.cmd.Init(1, 2, 3); |
1178 | 1258 |
1179 gl_->Uniform2f(1, 2, 3); | 1259 gl_->Uniform2f(1, 2, 3); |
1180 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1260 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1181 } | 1261 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 for (int ii = 0; ii < 2; ++ii) { | 1300 for (int ii = 0; ii < 2; ++ii) { |
1221 for (int jj = 0; jj < 2; ++jj) { | 1301 for (int jj = 0; jj < 2; ++jj) { |
1222 data[ii][jj] = static_cast<GLint>(ii * 2 + jj); | 1302 data[ii][jj] = static_cast<GLint>(ii * 2 + jj); |
1223 } | 1303 } |
1224 } | 1304 } |
1225 expected.cmd.Init(1, 2, &data[0][0]); | 1305 expected.cmd.Init(1, 2, &data[0][0]); |
1226 gl_->Uniform2iv(1, 2, &data[0][0]); | 1306 gl_->Uniform2iv(1, 2, &data[0][0]); |
1227 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1307 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1228 } | 1308 } |
1229 | 1309 |
| 1310 TEST_F(GLES2ImplementationTest, Uniform2ui) { |
| 1311 struct Cmds { |
| 1312 cmds::Uniform2ui cmd; |
| 1313 }; |
| 1314 Cmds expected; |
| 1315 expected.cmd.Init(1, 2, 3); |
| 1316 |
| 1317 gl_->Uniform2ui(1, 2, 3); |
| 1318 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1319 } |
| 1320 |
| 1321 TEST_F(GLES2ImplementationTest, Uniform2uiv) { |
| 1322 GLuint data[2][2] = {{0}}; |
| 1323 struct Cmds { |
| 1324 cmds::Uniform2uivImmediate cmd; |
| 1325 GLuint data[2][2]; |
| 1326 }; |
| 1327 |
| 1328 Cmds expected; |
| 1329 for (int ii = 0; ii < 2; ++ii) { |
| 1330 for (int jj = 0; jj < 2; ++jj) { |
| 1331 data[ii][jj] = static_cast<GLuint>(ii * 2 + jj); |
| 1332 } |
| 1333 } |
| 1334 expected.cmd.Init(1, 2, &data[0][0]); |
| 1335 gl_->Uniform2uiv(1, 2, &data[0][0]); |
| 1336 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1337 } |
| 1338 |
1230 TEST_F(GLES2ImplementationTest, Uniform3f) { | 1339 TEST_F(GLES2ImplementationTest, Uniform3f) { |
1231 struct Cmds { | 1340 struct Cmds { |
1232 cmds::Uniform3f cmd; | 1341 cmds::Uniform3f cmd; |
1233 }; | 1342 }; |
1234 Cmds expected; | 1343 Cmds expected; |
1235 expected.cmd.Init(1, 2, 3, 4); | 1344 expected.cmd.Init(1, 2, 3, 4); |
1236 | 1345 |
1237 gl_->Uniform3f(1, 2, 3, 4); | 1346 gl_->Uniform3f(1, 2, 3, 4); |
1238 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1347 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1239 } | 1348 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 for (int ii = 0; ii < 2; ++ii) { | 1387 for (int ii = 0; ii < 2; ++ii) { |
1279 for (int jj = 0; jj < 3; ++jj) { | 1388 for (int jj = 0; jj < 3; ++jj) { |
1280 data[ii][jj] = static_cast<GLint>(ii * 3 + jj); | 1389 data[ii][jj] = static_cast<GLint>(ii * 3 + jj); |
1281 } | 1390 } |
1282 } | 1391 } |
1283 expected.cmd.Init(1, 2, &data[0][0]); | 1392 expected.cmd.Init(1, 2, &data[0][0]); |
1284 gl_->Uniform3iv(1, 2, &data[0][0]); | 1393 gl_->Uniform3iv(1, 2, &data[0][0]); |
1285 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1394 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1286 } | 1395 } |
1287 | 1396 |
| 1397 TEST_F(GLES2ImplementationTest, Uniform3ui) { |
| 1398 struct Cmds { |
| 1399 cmds::Uniform3ui cmd; |
| 1400 }; |
| 1401 Cmds expected; |
| 1402 expected.cmd.Init(1, 2, 3, 4); |
| 1403 |
| 1404 gl_->Uniform3ui(1, 2, 3, 4); |
| 1405 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1406 } |
| 1407 |
| 1408 TEST_F(GLES2ImplementationTest, Uniform3uiv) { |
| 1409 GLuint data[2][3] = {{0}}; |
| 1410 struct Cmds { |
| 1411 cmds::Uniform3uivImmediate cmd; |
| 1412 GLuint data[2][3]; |
| 1413 }; |
| 1414 |
| 1415 Cmds expected; |
| 1416 for (int ii = 0; ii < 2; ++ii) { |
| 1417 for (int jj = 0; jj < 3; ++jj) { |
| 1418 data[ii][jj] = static_cast<GLuint>(ii * 3 + jj); |
| 1419 } |
| 1420 } |
| 1421 expected.cmd.Init(1, 2, &data[0][0]); |
| 1422 gl_->Uniform3uiv(1, 2, &data[0][0]); |
| 1423 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1424 } |
| 1425 |
1288 TEST_F(GLES2ImplementationTest, Uniform4f) { | 1426 TEST_F(GLES2ImplementationTest, Uniform4f) { |
1289 struct Cmds { | 1427 struct Cmds { |
1290 cmds::Uniform4f cmd; | 1428 cmds::Uniform4f cmd; |
1291 }; | 1429 }; |
1292 Cmds expected; | 1430 Cmds expected; |
1293 expected.cmd.Init(1, 2, 3, 4, 5); | 1431 expected.cmd.Init(1, 2, 3, 4, 5); |
1294 | 1432 |
1295 gl_->Uniform4f(1, 2, 3, 4, 5); | 1433 gl_->Uniform4f(1, 2, 3, 4, 5); |
1296 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1434 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1297 } | 1435 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 for (int ii = 0; ii < 2; ++ii) { | 1474 for (int ii = 0; ii < 2; ++ii) { |
1337 for (int jj = 0; jj < 4; ++jj) { | 1475 for (int jj = 0; jj < 4; ++jj) { |
1338 data[ii][jj] = static_cast<GLint>(ii * 4 + jj); | 1476 data[ii][jj] = static_cast<GLint>(ii * 4 + jj); |
1339 } | 1477 } |
1340 } | 1478 } |
1341 expected.cmd.Init(1, 2, &data[0][0]); | 1479 expected.cmd.Init(1, 2, &data[0][0]); |
1342 gl_->Uniform4iv(1, 2, &data[0][0]); | 1480 gl_->Uniform4iv(1, 2, &data[0][0]); |
1343 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1481 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1344 } | 1482 } |
1345 | 1483 |
| 1484 TEST_F(GLES2ImplementationTest, Uniform4ui) { |
| 1485 struct Cmds { |
| 1486 cmds::Uniform4ui cmd; |
| 1487 }; |
| 1488 Cmds expected; |
| 1489 expected.cmd.Init(1, 2, 3, 4, 5); |
| 1490 |
| 1491 gl_->Uniform4ui(1, 2, 3, 4, 5); |
| 1492 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1493 } |
| 1494 |
| 1495 TEST_F(GLES2ImplementationTest, Uniform4uiv) { |
| 1496 GLuint data[2][4] = {{0}}; |
| 1497 struct Cmds { |
| 1498 cmds::Uniform4uivImmediate cmd; |
| 1499 GLuint data[2][4]; |
| 1500 }; |
| 1501 |
| 1502 Cmds expected; |
| 1503 for (int ii = 0; ii < 2; ++ii) { |
| 1504 for (int jj = 0; jj < 4; ++jj) { |
| 1505 data[ii][jj] = static_cast<GLuint>(ii * 4 + jj); |
| 1506 } |
| 1507 } |
| 1508 expected.cmd.Init(1, 2, &data[0][0]); |
| 1509 gl_->Uniform4uiv(1, 2, &data[0][0]); |
| 1510 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1511 } |
| 1512 |
1346 TEST_F(GLES2ImplementationTest, UniformMatrix2fv) { | 1513 TEST_F(GLES2ImplementationTest, UniformMatrix2fv) { |
1347 GLfloat data[2][4] = {{0}}; | 1514 GLfloat data[2][4] = {{0}}; |
1348 struct Cmds { | 1515 struct Cmds { |
1349 cmds::UniformMatrix2fvImmediate cmd; | 1516 cmds::UniformMatrix2fvImmediate cmd; |
1350 GLfloat data[2][4]; | 1517 GLfloat data[2][4]; |
1351 }; | 1518 }; |
1352 | 1519 |
1353 Cmds expected; | 1520 Cmds expected; |
1354 for (int ii = 0; ii < 2; ++ii) { | 1521 for (int ii = 0; ii < 2; ++ii) { |
1355 for (int jj = 0; jj < 4; ++jj) { | 1522 for (int jj = 0; jj < 4; ++jj) { |
(...skipping 10 matching lines...) Expand all Loading... |
1366 for (int ii = 0; ii < 2; ++ii) { | 1533 for (int ii = 0; ii < 2; ++ii) { |
1367 for (int jj = 0; jj < 4; ++jj) { | 1534 for (int jj = 0; jj < 4; ++jj) { |
1368 data[ii][jj] = static_cast<GLfloat>(ii * 4 + jj); | 1535 data[ii][jj] = static_cast<GLfloat>(ii * 4 + jj); |
1369 } | 1536 } |
1370 } | 1537 } |
1371 gl_->UniformMatrix2fv(1, 2, true, &data[0][0]); | 1538 gl_->UniformMatrix2fv(1, 2, true, &data[0][0]); |
1372 EXPECT_TRUE(NoCommandsWritten()); | 1539 EXPECT_TRUE(NoCommandsWritten()); |
1373 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 1540 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
1374 } | 1541 } |
1375 | 1542 |
| 1543 TEST_F(GLES2ImplementationTest, UniformMatrix2x3fv) { |
| 1544 GLfloat data[2][6] = {{0}}; |
| 1545 struct Cmds { |
| 1546 cmds::UniformMatrix2x3fvImmediate cmd; |
| 1547 GLfloat data[2][6]; |
| 1548 }; |
| 1549 |
| 1550 Cmds expected; |
| 1551 for (int ii = 0; ii < 2; ++ii) { |
| 1552 for (int jj = 0; jj < 6; ++jj) { |
| 1553 data[ii][jj] = static_cast<GLfloat>(ii * 6 + jj); |
| 1554 } |
| 1555 } |
| 1556 expected.cmd.Init(1, 2, &data[0][0]); |
| 1557 gl_->UniformMatrix2x3fv(1, 2, false, &data[0][0]); |
| 1558 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1559 } |
| 1560 |
| 1561 TEST_F(GLES2ImplementationTest, UniformMatrix2x3fvInvalidConstantArg2) { |
| 1562 GLfloat data[2][6] = {{0}}; |
| 1563 for (int ii = 0; ii < 2; ++ii) { |
| 1564 for (int jj = 0; jj < 6; ++jj) { |
| 1565 data[ii][jj] = static_cast<GLfloat>(ii * 6 + jj); |
| 1566 } |
| 1567 } |
| 1568 gl_->UniformMatrix2x3fv(1, 2, true, &data[0][0]); |
| 1569 EXPECT_TRUE(NoCommandsWritten()); |
| 1570 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1571 } |
| 1572 |
| 1573 TEST_F(GLES2ImplementationTest, UniformMatrix2x4fv) { |
| 1574 GLfloat data[2][8] = {{0}}; |
| 1575 struct Cmds { |
| 1576 cmds::UniformMatrix2x4fvImmediate cmd; |
| 1577 GLfloat data[2][8]; |
| 1578 }; |
| 1579 |
| 1580 Cmds expected; |
| 1581 for (int ii = 0; ii < 2; ++ii) { |
| 1582 for (int jj = 0; jj < 8; ++jj) { |
| 1583 data[ii][jj] = static_cast<GLfloat>(ii * 8 + jj); |
| 1584 } |
| 1585 } |
| 1586 expected.cmd.Init(1, 2, &data[0][0]); |
| 1587 gl_->UniformMatrix2x4fv(1, 2, false, &data[0][0]); |
| 1588 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1589 } |
| 1590 |
| 1591 TEST_F(GLES2ImplementationTest, UniformMatrix2x4fvInvalidConstantArg2) { |
| 1592 GLfloat data[2][8] = {{0}}; |
| 1593 for (int ii = 0; ii < 2; ++ii) { |
| 1594 for (int jj = 0; jj < 8; ++jj) { |
| 1595 data[ii][jj] = static_cast<GLfloat>(ii * 8 + jj); |
| 1596 } |
| 1597 } |
| 1598 gl_->UniformMatrix2x4fv(1, 2, true, &data[0][0]); |
| 1599 EXPECT_TRUE(NoCommandsWritten()); |
| 1600 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1601 } |
| 1602 |
1376 TEST_F(GLES2ImplementationTest, UniformMatrix3fv) { | 1603 TEST_F(GLES2ImplementationTest, UniformMatrix3fv) { |
1377 GLfloat data[2][9] = {{0}}; | 1604 GLfloat data[2][9] = {{0}}; |
1378 struct Cmds { | 1605 struct Cmds { |
1379 cmds::UniformMatrix3fvImmediate cmd; | 1606 cmds::UniformMatrix3fvImmediate cmd; |
1380 GLfloat data[2][9]; | 1607 GLfloat data[2][9]; |
1381 }; | 1608 }; |
1382 | 1609 |
1383 Cmds expected; | 1610 Cmds expected; |
1384 for (int ii = 0; ii < 2; ++ii) { | 1611 for (int ii = 0; ii < 2; ++ii) { |
1385 for (int jj = 0; jj < 9; ++jj) { | 1612 for (int jj = 0; jj < 9; ++jj) { |
(...skipping 10 matching lines...) Expand all Loading... |
1396 for (int ii = 0; ii < 2; ++ii) { | 1623 for (int ii = 0; ii < 2; ++ii) { |
1397 for (int jj = 0; jj < 9; ++jj) { | 1624 for (int jj = 0; jj < 9; ++jj) { |
1398 data[ii][jj] = static_cast<GLfloat>(ii * 9 + jj); | 1625 data[ii][jj] = static_cast<GLfloat>(ii * 9 + jj); |
1399 } | 1626 } |
1400 } | 1627 } |
1401 gl_->UniformMatrix3fv(1, 2, true, &data[0][0]); | 1628 gl_->UniformMatrix3fv(1, 2, true, &data[0][0]); |
1402 EXPECT_TRUE(NoCommandsWritten()); | 1629 EXPECT_TRUE(NoCommandsWritten()); |
1403 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 1630 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
1404 } | 1631 } |
1405 | 1632 |
| 1633 TEST_F(GLES2ImplementationTest, UniformMatrix3x2fv) { |
| 1634 GLfloat data[2][6] = {{0}}; |
| 1635 struct Cmds { |
| 1636 cmds::UniformMatrix3x2fvImmediate cmd; |
| 1637 GLfloat data[2][6]; |
| 1638 }; |
| 1639 |
| 1640 Cmds expected; |
| 1641 for (int ii = 0; ii < 2; ++ii) { |
| 1642 for (int jj = 0; jj < 6; ++jj) { |
| 1643 data[ii][jj] = static_cast<GLfloat>(ii * 6 + jj); |
| 1644 } |
| 1645 } |
| 1646 expected.cmd.Init(1, 2, &data[0][0]); |
| 1647 gl_->UniformMatrix3x2fv(1, 2, false, &data[0][0]); |
| 1648 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1649 } |
| 1650 |
| 1651 TEST_F(GLES2ImplementationTest, UniformMatrix3x2fvInvalidConstantArg2) { |
| 1652 GLfloat data[2][6] = {{0}}; |
| 1653 for (int ii = 0; ii < 2; ++ii) { |
| 1654 for (int jj = 0; jj < 6; ++jj) { |
| 1655 data[ii][jj] = static_cast<GLfloat>(ii * 6 + jj); |
| 1656 } |
| 1657 } |
| 1658 gl_->UniformMatrix3x2fv(1, 2, true, &data[0][0]); |
| 1659 EXPECT_TRUE(NoCommandsWritten()); |
| 1660 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1661 } |
| 1662 |
| 1663 TEST_F(GLES2ImplementationTest, UniformMatrix3x4fv) { |
| 1664 GLfloat data[2][12] = {{0}}; |
| 1665 struct Cmds { |
| 1666 cmds::UniformMatrix3x4fvImmediate cmd; |
| 1667 GLfloat data[2][12]; |
| 1668 }; |
| 1669 |
| 1670 Cmds expected; |
| 1671 for (int ii = 0; ii < 2; ++ii) { |
| 1672 for (int jj = 0; jj < 12; ++jj) { |
| 1673 data[ii][jj] = static_cast<GLfloat>(ii * 12 + jj); |
| 1674 } |
| 1675 } |
| 1676 expected.cmd.Init(1, 2, &data[0][0]); |
| 1677 gl_->UniformMatrix3x4fv(1, 2, false, &data[0][0]); |
| 1678 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1679 } |
| 1680 |
| 1681 TEST_F(GLES2ImplementationTest, UniformMatrix3x4fvInvalidConstantArg2) { |
| 1682 GLfloat data[2][12] = {{0}}; |
| 1683 for (int ii = 0; ii < 2; ++ii) { |
| 1684 for (int jj = 0; jj < 12; ++jj) { |
| 1685 data[ii][jj] = static_cast<GLfloat>(ii * 12 + jj); |
| 1686 } |
| 1687 } |
| 1688 gl_->UniformMatrix3x4fv(1, 2, true, &data[0][0]); |
| 1689 EXPECT_TRUE(NoCommandsWritten()); |
| 1690 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1691 } |
| 1692 |
1406 TEST_F(GLES2ImplementationTest, UniformMatrix4fv) { | 1693 TEST_F(GLES2ImplementationTest, UniformMatrix4fv) { |
1407 GLfloat data[2][16] = {{0}}; | 1694 GLfloat data[2][16] = {{0}}; |
1408 struct Cmds { | 1695 struct Cmds { |
1409 cmds::UniformMatrix4fvImmediate cmd; | 1696 cmds::UniformMatrix4fvImmediate cmd; |
1410 GLfloat data[2][16]; | 1697 GLfloat data[2][16]; |
1411 }; | 1698 }; |
1412 | 1699 |
1413 Cmds expected; | 1700 Cmds expected; |
1414 for (int ii = 0; ii < 2; ++ii) { | 1701 for (int ii = 0; ii < 2; ++ii) { |
1415 for (int jj = 0; jj < 16; ++jj) { | 1702 for (int jj = 0; jj < 16; ++jj) { |
(...skipping 10 matching lines...) Expand all Loading... |
1426 for (int ii = 0; ii < 2; ++ii) { | 1713 for (int ii = 0; ii < 2; ++ii) { |
1427 for (int jj = 0; jj < 16; ++jj) { | 1714 for (int jj = 0; jj < 16; ++jj) { |
1428 data[ii][jj] = static_cast<GLfloat>(ii * 16 + jj); | 1715 data[ii][jj] = static_cast<GLfloat>(ii * 16 + jj); |
1429 } | 1716 } |
1430 } | 1717 } |
1431 gl_->UniformMatrix4fv(1, 2, true, &data[0][0]); | 1718 gl_->UniformMatrix4fv(1, 2, true, &data[0][0]); |
1432 EXPECT_TRUE(NoCommandsWritten()); | 1719 EXPECT_TRUE(NoCommandsWritten()); |
1433 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); | 1720 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
1434 } | 1721 } |
1435 | 1722 |
| 1723 TEST_F(GLES2ImplementationTest, UniformMatrix4x2fv) { |
| 1724 GLfloat data[2][8] = {{0}}; |
| 1725 struct Cmds { |
| 1726 cmds::UniformMatrix4x2fvImmediate cmd; |
| 1727 GLfloat data[2][8]; |
| 1728 }; |
| 1729 |
| 1730 Cmds expected; |
| 1731 for (int ii = 0; ii < 2; ++ii) { |
| 1732 for (int jj = 0; jj < 8; ++jj) { |
| 1733 data[ii][jj] = static_cast<GLfloat>(ii * 8 + jj); |
| 1734 } |
| 1735 } |
| 1736 expected.cmd.Init(1, 2, &data[0][0]); |
| 1737 gl_->UniformMatrix4x2fv(1, 2, false, &data[0][0]); |
| 1738 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1739 } |
| 1740 |
| 1741 TEST_F(GLES2ImplementationTest, UniformMatrix4x2fvInvalidConstantArg2) { |
| 1742 GLfloat data[2][8] = {{0}}; |
| 1743 for (int ii = 0; ii < 2; ++ii) { |
| 1744 for (int jj = 0; jj < 8; ++jj) { |
| 1745 data[ii][jj] = static_cast<GLfloat>(ii * 8 + jj); |
| 1746 } |
| 1747 } |
| 1748 gl_->UniformMatrix4x2fv(1, 2, true, &data[0][0]); |
| 1749 EXPECT_TRUE(NoCommandsWritten()); |
| 1750 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1751 } |
| 1752 |
| 1753 TEST_F(GLES2ImplementationTest, UniformMatrix4x3fv) { |
| 1754 GLfloat data[2][12] = {{0}}; |
| 1755 struct Cmds { |
| 1756 cmds::UniformMatrix4x3fvImmediate cmd; |
| 1757 GLfloat data[2][12]; |
| 1758 }; |
| 1759 |
| 1760 Cmds expected; |
| 1761 for (int ii = 0; ii < 2; ++ii) { |
| 1762 for (int jj = 0; jj < 12; ++jj) { |
| 1763 data[ii][jj] = static_cast<GLfloat>(ii * 12 + jj); |
| 1764 } |
| 1765 } |
| 1766 expected.cmd.Init(1, 2, &data[0][0]); |
| 1767 gl_->UniformMatrix4x3fv(1, 2, false, &data[0][0]); |
| 1768 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1769 } |
| 1770 |
| 1771 TEST_F(GLES2ImplementationTest, UniformMatrix4x3fvInvalidConstantArg2) { |
| 1772 GLfloat data[2][12] = {{0}}; |
| 1773 for (int ii = 0; ii < 2; ++ii) { |
| 1774 for (int jj = 0; jj < 12; ++jj) { |
| 1775 data[ii][jj] = static_cast<GLfloat>(ii * 12 + jj); |
| 1776 } |
| 1777 } |
| 1778 gl_->UniformMatrix4x3fv(1, 2, true, &data[0][0]); |
| 1779 EXPECT_TRUE(NoCommandsWritten()); |
| 1780 EXPECT_EQ(GL_INVALID_VALUE, CheckError()); |
| 1781 } |
| 1782 |
1436 TEST_F(GLES2ImplementationTest, UseProgram) { | 1783 TEST_F(GLES2ImplementationTest, UseProgram) { |
1437 struct Cmds { | 1784 struct Cmds { |
1438 cmds::UseProgram cmd; | 1785 cmds::UseProgram cmd; |
1439 }; | 1786 }; |
1440 Cmds expected; | 1787 Cmds expected; |
1441 expected.cmd.Init(1); | 1788 expected.cmd.Init(1); |
1442 | 1789 |
1443 gl_->UseProgram(1); | 1790 gl_->UseProgram(1); |
1444 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1791 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1445 ClearCommands(); | 1792 ClearCommands(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 | 1906 |
1560 for (int jj = 0; jj < 4; ++jj) { | 1907 for (int jj = 0; jj < 4; ++jj) { |
1561 data[jj] = static_cast<GLfloat>(jj); | 1908 data[jj] = static_cast<GLfloat>(jj); |
1562 } | 1909 } |
1563 Cmds expected; | 1910 Cmds expected; |
1564 expected.cmd.Init(1, &data[0]); | 1911 expected.cmd.Init(1, &data[0]); |
1565 gl_->VertexAttrib4fv(1, &data[0]); | 1912 gl_->VertexAttrib4fv(1, &data[0]); |
1566 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1913 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1567 } | 1914 } |
1568 | 1915 |
| 1916 TEST_F(GLES2ImplementationTest, VertexAttribI4i) { |
| 1917 struct Cmds { |
| 1918 cmds::VertexAttribI4i cmd; |
| 1919 }; |
| 1920 Cmds expected; |
| 1921 expected.cmd.Init(1, 2, 3, 4, 5); |
| 1922 |
| 1923 gl_->VertexAttribI4i(1, 2, 3, 4, 5); |
| 1924 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1925 } |
| 1926 |
| 1927 TEST_F(GLES2ImplementationTest, VertexAttribI4iv) { |
| 1928 GLint data[4] = {0}; |
| 1929 struct Cmds { |
| 1930 cmds::VertexAttribI4ivImmediate cmd; |
| 1931 GLint data[4]; |
| 1932 }; |
| 1933 |
| 1934 for (int jj = 0; jj < 4; ++jj) { |
| 1935 data[jj] = static_cast<GLint>(jj); |
| 1936 } |
| 1937 Cmds expected; |
| 1938 expected.cmd.Init(1, &data[0]); |
| 1939 gl_->VertexAttribI4iv(1, &data[0]); |
| 1940 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1941 } |
| 1942 |
| 1943 TEST_F(GLES2ImplementationTest, VertexAttribI4ui) { |
| 1944 struct Cmds { |
| 1945 cmds::VertexAttribI4ui cmd; |
| 1946 }; |
| 1947 Cmds expected; |
| 1948 expected.cmd.Init(1, 2, 3, 4, 5); |
| 1949 |
| 1950 gl_->VertexAttribI4ui(1, 2, 3, 4, 5); |
| 1951 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1952 } |
| 1953 |
| 1954 TEST_F(GLES2ImplementationTest, VertexAttribI4uiv) { |
| 1955 GLuint data[4] = {0}; |
| 1956 struct Cmds { |
| 1957 cmds::VertexAttribI4uivImmediate cmd; |
| 1958 GLuint data[4]; |
| 1959 }; |
| 1960 |
| 1961 for (int jj = 0; jj < 4; ++jj) { |
| 1962 data[jj] = static_cast<GLuint>(jj); |
| 1963 } |
| 1964 Cmds expected; |
| 1965 expected.cmd.Init(1, &data[0]); |
| 1966 gl_->VertexAttribI4uiv(1, &data[0]); |
| 1967 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1968 } |
| 1969 |
1569 TEST_F(GLES2ImplementationTest, Viewport) { | 1970 TEST_F(GLES2ImplementationTest, Viewport) { |
1570 struct Cmds { | 1971 struct Cmds { |
1571 cmds::Viewport cmd; | 1972 cmds::Viewport cmd; |
1572 }; | 1973 }; |
1573 Cmds expected; | 1974 Cmds expected; |
1574 expected.cmd.Init(1, 2, 3, 4); | 1975 expected.cmd.Init(1, 2, 3, 4); |
1575 | 1976 |
1576 gl_->Viewport(1, 2, 3, 4); | 1977 gl_->Viewport(1, 2, 3, 4); |
1577 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1978 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1578 } | 1979 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 struct Cmds { | 2416 struct Cmds { |
2016 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2417 cmds::MatrixLoadIdentityCHROMIUM cmd; |
2017 }; | 2418 }; |
2018 Cmds expected; | 2419 Cmds expected; |
2019 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2420 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
2020 | 2421 |
2021 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 2422 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
2022 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2423 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2023 } | 2424 } |
2024 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 2425 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
OLD | NEW |