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 49 matching lines...) Loading... |
60 Cmds expected; | 60 Cmds expected; |
61 expected.cmd.Init(GL_RENDERBUFFER, 2); | 61 expected.cmd.Init(GL_RENDERBUFFER, 2); |
62 | 62 |
63 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2); | 63 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2); |
64 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 64 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
65 ClearCommands(); | 65 ClearCommands(); |
66 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2); | 66 gl_->BindRenderbuffer(GL_RENDERBUFFER, 2); |
67 EXPECT_TRUE(NoCommandsWritten()); | 67 EXPECT_TRUE(NoCommandsWritten()); |
68 } | 68 } |
69 | 69 |
| 70 TEST_F(GLES2ImplementationTest, BindSampler) { |
| 71 struct Cmds { |
| 72 cmds::BindSampler cmd; |
| 73 }; |
| 74 Cmds expected; |
| 75 expected.cmd.Init(1, 2); |
| 76 |
| 77 gl_->BindSampler(1, 2); |
| 78 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 79 } |
| 80 |
| 81 TEST_F(GLES2ImplementationTest, BindTransformFeedback) { |
| 82 struct Cmds { |
| 83 cmds::BindTransformFeedback cmd; |
| 84 }; |
| 85 Cmds expected; |
| 86 expected.cmd.Init(GL_TRANSFORM_FEEDBACK, 2); |
| 87 |
| 88 gl_->BindTransformFeedback(GL_TRANSFORM_FEEDBACK, 2); |
| 89 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 90 } |
| 91 |
70 TEST_F(GLES2ImplementationTest, BlendColor) { | 92 TEST_F(GLES2ImplementationTest, BlendColor) { |
71 struct Cmds { | 93 struct Cmds { |
72 cmds::BlendColor cmd; | 94 cmds::BlendColor cmd; |
73 }; | 95 }; |
74 Cmds expected; | 96 Cmds expected; |
75 expected.cmd.Init(1, 2, 3, 4); | 97 expected.cmd.Init(1, 2, 3, 4); |
76 | 98 |
77 gl_->BlendColor(1, 2, 3, 4); | 99 gl_->BlendColor(1, 2, 3, 4); |
78 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 100 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
79 } | 101 } |
(...skipping 225 matching lines...) Loading... |
305 GLuint data[2]; | 327 GLuint data[2]; |
306 }; | 328 }; |
307 Cmds expected; | 329 Cmds expected; |
308 expected.del.Init(arraysize(ids), &ids[0]); | 330 expected.del.Init(arraysize(ids), &ids[0]); |
309 expected.data[0] = kRenderbuffersStartId; | 331 expected.data[0] = kRenderbuffersStartId; |
310 expected.data[1] = kRenderbuffersStartId + 1; | 332 expected.data[1] = kRenderbuffersStartId + 1; |
311 gl_->DeleteRenderbuffers(arraysize(ids), &ids[0]); | 333 gl_->DeleteRenderbuffers(arraysize(ids), &ids[0]); |
312 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 334 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
313 } | 335 } |
314 | 336 |
| 337 TEST_F(GLES2ImplementationTest, DeleteSamplers) { |
| 338 GLuint ids[2] = {kSamplersStartId, kSamplersStartId + 1}; |
| 339 struct Cmds { |
| 340 cmds::DeleteSamplersImmediate del; |
| 341 GLuint data[2]; |
| 342 }; |
| 343 Cmds expected; |
| 344 expected.del.Init(arraysize(ids), &ids[0]); |
| 345 expected.data[0] = kSamplersStartId; |
| 346 expected.data[1] = kSamplersStartId + 1; |
| 347 gl_->DeleteSamplers(arraysize(ids), &ids[0]); |
| 348 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 349 } |
| 350 |
315 TEST_F(GLES2ImplementationTest, DeleteShader) { | 351 TEST_F(GLES2ImplementationTest, DeleteShader) { |
316 struct Cmds { | 352 struct Cmds { |
317 cmds::DeleteShader cmd; | 353 cmds::DeleteShader cmd; |
318 }; | 354 }; |
319 Cmds expected; | 355 Cmds expected; |
320 expected.cmd.Init(1); | 356 expected.cmd.Init(1); |
321 | 357 |
322 gl_->DeleteShader(1); | 358 gl_->DeleteShader(1); |
323 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 359 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
324 } | 360 } |
325 | 361 |
326 TEST_F(GLES2ImplementationTest, DeleteTextures) { | 362 TEST_F(GLES2ImplementationTest, DeleteTextures) { |
327 GLuint ids[2] = {kTexturesStartId, kTexturesStartId + 1}; | 363 GLuint ids[2] = {kTexturesStartId, kTexturesStartId + 1}; |
328 struct Cmds { | 364 struct Cmds { |
329 cmds::DeleteTexturesImmediate del; | 365 cmds::DeleteTexturesImmediate del; |
330 GLuint data[2]; | 366 GLuint data[2]; |
331 }; | 367 }; |
332 Cmds expected; | 368 Cmds expected; |
333 expected.del.Init(arraysize(ids), &ids[0]); | 369 expected.del.Init(arraysize(ids), &ids[0]); |
334 expected.data[0] = kTexturesStartId; | 370 expected.data[0] = kTexturesStartId; |
335 expected.data[1] = kTexturesStartId + 1; | 371 expected.data[1] = kTexturesStartId + 1; |
336 gl_->DeleteTextures(arraysize(ids), &ids[0]); | 372 gl_->DeleteTextures(arraysize(ids), &ids[0]); |
337 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 373 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
338 } | 374 } |
339 | 375 |
| 376 TEST_F(GLES2ImplementationTest, DeleteTransformFeedbacks) { |
| 377 GLuint ids[2] = {kTransformFeedbacksStartId, kTransformFeedbacksStartId + 1}; |
| 378 struct Cmds { |
| 379 cmds::DeleteTransformFeedbacksImmediate del; |
| 380 GLuint data[2]; |
| 381 }; |
| 382 Cmds expected; |
| 383 expected.del.Init(arraysize(ids), &ids[0]); |
| 384 expected.data[0] = kTransformFeedbacksStartId; |
| 385 expected.data[1] = kTransformFeedbacksStartId + 1; |
| 386 gl_->DeleteTransformFeedbacks(arraysize(ids), &ids[0]); |
| 387 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 388 } |
| 389 |
340 TEST_F(GLES2ImplementationTest, DepthFunc) { | 390 TEST_F(GLES2ImplementationTest, DepthFunc) { |
341 struct Cmds { | 391 struct Cmds { |
342 cmds::DepthFunc cmd; | 392 cmds::DepthFunc cmd; |
343 }; | 393 }; |
344 Cmds expected; | 394 Cmds expected; |
345 expected.cmd.Init(GL_NEVER); | 395 expected.cmd.Init(GL_NEVER); |
346 | 396 |
347 gl_->DepthFunc(GL_NEVER); | 397 gl_->DepthFunc(GL_NEVER); |
348 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 398 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
349 } | 399 } |
(...skipping 186 matching lines...) Loading... |
536 Cmds expected; | 586 Cmds expected; |
537 expected.gen.Init(arraysize(ids), &ids[0]); | 587 expected.gen.Init(arraysize(ids), &ids[0]); |
538 expected.data[0] = kRenderbuffersStartId; | 588 expected.data[0] = kRenderbuffersStartId; |
539 expected.data[1] = kRenderbuffersStartId + 1; | 589 expected.data[1] = kRenderbuffersStartId + 1; |
540 gl_->GenRenderbuffers(arraysize(ids), &ids[0]); | 590 gl_->GenRenderbuffers(arraysize(ids), &ids[0]); |
541 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 591 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
542 EXPECT_EQ(kRenderbuffersStartId, ids[0]); | 592 EXPECT_EQ(kRenderbuffersStartId, ids[0]); |
543 EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]); | 593 EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]); |
544 } | 594 } |
545 | 595 |
| 596 TEST_F(GLES2ImplementationTest, GenSamplers) { |
| 597 GLuint ids[2] = { |
| 598 0, |
| 599 }; |
| 600 struct Cmds { |
| 601 cmds::GenSamplersImmediate gen; |
| 602 GLuint data[2]; |
| 603 }; |
| 604 Cmds expected; |
| 605 expected.gen.Init(arraysize(ids), &ids[0]); |
| 606 expected.data[0] = kSamplersStartId; |
| 607 expected.data[1] = kSamplersStartId + 1; |
| 608 gl_->GenSamplers(arraysize(ids), &ids[0]); |
| 609 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 610 EXPECT_EQ(kSamplersStartId, ids[0]); |
| 611 EXPECT_EQ(kSamplersStartId + 1, ids[1]); |
| 612 } |
| 613 |
546 TEST_F(GLES2ImplementationTest, GenTextures) { | 614 TEST_F(GLES2ImplementationTest, GenTextures) { |
547 GLuint ids[2] = { | 615 GLuint ids[2] = { |
548 0, | 616 0, |
549 }; | 617 }; |
550 struct Cmds { | 618 struct Cmds { |
551 cmds::GenTexturesImmediate gen; | 619 cmds::GenTexturesImmediate gen; |
552 GLuint data[2]; | 620 GLuint data[2]; |
553 }; | 621 }; |
554 Cmds expected; | 622 Cmds expected; |
555 expected.gen.Init(arraysize(ids), &ids[0]); | 623 expected.gen.Init(arraysize(ids), &ids[0]); |
556 expected.data[0] = kTexturesStartId; | 624 expected.data[0] = kTexturesStartId; |
557 expected.data[1] = kTexturesStartId + 1; | 625 expected.data[1] = kTexturesStartId + 1; |
558 gl_->GenTextures(arraysize(ids), &ids[0]); | 626 gl_->GenTextures(arraysize(ids), &ids[0]); |
559 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 627 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
560 EXPECT_EQ(kTexturesStartId, ids[0]); | 628 EXPECT_EQ(kTexturesStartId, ids[0]); |
561 EXPECT_EQ(kTexturesStartId + 1, ids[1]); | 629 EXPECT_EQ(kTexturesStartId + 1, ids[1]); |
562 } | 630 } |
| 631 |
| 632 TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) { |
| 633 GLuint ids[2] = { |
| 634 0, |
| 635 }; |
| 636 struct Cmds { |
| 637 cmds::GenTransformFeedbacksImmediate gen; |
| 638 GLuint data[2]; |
| 639 }; |
| 640 Cmds expected; |
| 641 expected.gen.Init(arraysize(ids), &ids[0]); |
| 642 expected.data[0] = kTransformFeedbacksStartId; |
| 643 expected.data[1] = kTransformFeedbacksStartId + 1; |
| 644 gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]); |
| 645 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 646 EXPECT_EQ(kTransformFeedbacksStartId, ids[0]); |
| 647 EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]); |
| 648 } |
563 // TODO: Implement unit test for GetActiveAttrib | 649 // TODO: Implement unit test for GetActiveAttrib |
564 // TODO: Implement unit test for GetActiveUniform | 650 // TODO: Implement unit test for GetActiveUniform |
565 // TODO: Implement unit test for GetAttachedShaders | 651 // TODO: Implement unit test for GetAttachedShaders |
566 // TODO: Implement unit test for GetAttribLocation | 652 // TODO: Implement unit test for GetAttribLocation |
567 | 653 |
568 TEST_F(GLES2ImplementationTest, GetBooleanv) { | 654 TEST_F(GLES2ImplementationTest, GetBooleanv) { |
569 struct Cmds { | 655 struct Cmds { |
570 cmds::GetBooleanv cmd; | 656 cmds::GetBooleanv cmd; |
571 }; | 657 }; |
572 typedef cmds::GetBooleanv::Result Result; | 658 typedef cmds::GetBooleanv::Result Result; |
(...skipping 127 matching lines...) Loading... |
700 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 786 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
701 expected.cmd.Init(123, GL_RENDERBUFFER_RED_SIZE, result1.id, result1.offset); | 787 expected.cmd.Init(123, GL_RENDERBUFFER_RED_SIZE, result1.id, result1.offset); |
702 EXPECT_CALL(*command_buffer(), OnFlush()) | 788 EXPECT_CALL(*command_buffer(), OnFlush()) |
703 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) | 789 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
704 .RetiresOnSaturation(); | 790 .RetiresOnSaturation(); |
705 gl_->GetRenderbufferParameteriv(123, GL_RENDERBUFFER_RED_SIZE, &result); | 791 gl_->GetRenderbufferParameteriv(123, GL_RENDERBUFFER_RED_SIZE, &result); |
706 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 792 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
707 EXPECT_EQ(static_cast<Result::Type>(1), result); | 793 EXPECT_EQ(static_cast<Result::Type>(1), result); |
708 } | 794 } |
709 | 795 |
| 796 TEST_F(GLES2ImplementationTest, GetSamplerParameterfv) { |
| 797 struct Cmds { |
| 798 cmds::GetSamplerParameterfv cmd; |
| 799 }; |
| 800 typedef cmds::GetSamplerParameterfv::Result Result; |
| 801 Result::Type result = 0; |
| 802 Cmds expected; |
| 803 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 804 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); |
| 805 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 806 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 807 .RetiresOnSaturation(); |
| 808 gl_->GetSamplerParameterfv(123, GL_TEXTURE_MAG_FILTER, &result); |
| 809 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 810 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 811 } |
| 812 |
| 813 TEST_F(GLES2ImplementationTest, GetSamplerParameteriv) { |
| 814 struct Cmds { |
| 815 cmds::GetSamplerParameteriv cmd; |
| 816 }; |
| 817 typedef cmds::GetSamplerParameteriv::Result Result; |
| 818 Result::Type result = 0; |
| 819 Cmds expected; |
| 820 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
| 821 expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset); |
| 822 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 823 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1))) |
| 824 .RetiresOnSaturation(); |
| 825 gl_->GetSamplerParameteriv(123, GL_TEXTURE_MAG_FILTER, &result); |
| 826 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 827 EXPECT_EQ(static_cast<Result::Type>(1), result); |
| 828 } |
| 829 |
710 TEST_F(GLES2ImplementationTest, GetShaderiv) { | 830 TEST_F(GLES2ImplementationTest, GetShaderiv) { |
711 struct Cmds { | 831 struct Cmds { |
712 cmds::GetShaderiv cmd; | 832 cmds::GetShaderiv cmd; |
713 }; | 833 }; |
714 typedef cmds::GetShaderiv::Result Result; | 834 typedef cmds::GetShaderiv::Result Result; |
715 Result::Type result = 0; | 835 Result::Type result = 0; |
716 Cmds expected; | 836 Cmds expected; |
717 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); | 837 ExpectedMemoryInfo result1 = GetExpectedResultMemory(4); |
718 expected.cmd.Init(123, GL_SHADER_TYPE, result1.id, result1.offset); | 838 expected.cmd.Init(123, GL_SHADER_TYPE, result1.id, result1.offset); |
719 EXPECT_CALL(*command_buffer(), OnFlush()) | 839 EXPECT_CALL(*command_buffer(), OnFlush()) |
(...skipping 214 matching lines...) Loading... |
934 | 1054 |
935 EXPECT_CALL(*command_buffer(), OnFlush()) | 1055 EXPECT_CALL(*command_buffer(), OnFlush()) |
936 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) | 1056 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
937 .RetiresOnSaturation(); | 1057 .RetiresOnSaturation(); |
938 | 1058 |
939 GLboolean result = gl_->IsRenderbuffer(1); | 1059 GLboolean result = gl_->IsRenderbuffer(1); |
940 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1060 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
941 EXPECT_TRUE(result); | 1061 EXPECT_TRUE(result); |
942 } | 1062 } |
943 | 1063 |
| 1064 TEST_F(GLES2ImplementationTest, IsSampler) { |
| 1065 struct Cmds { |
| 1066 cmds::IsSampler cmd; |
| 1067 }; |
| 1068 |
| 1069 Cmds expected; |
| 1070 ExpectedMemoryInfo result1 = |
| 1071 GetExpectedResultMemory(sizeof(cmds::IsSampler::Result)); |
| 1072 expected.cmd.Init(1, result1.id, result1.offset); |
| 1073 |
| 1074 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 1075 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 1076 .RetiresOnSaturation(); |
| 1077 |
| 1078 GLboolean result = gl_->IsSampler(1); |
| 1079 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1080 EXPECT_TRUE(result); |
| 1081 } |
| 1082 |
944 TEST_F(GLES2ImplementationTest, IsShader) { | 1083 TEST_F(GLES2ImplementationTest, IsShader) { |
945 struct Cmds { | 1084 struct Cmds { |
946 cmds::IsShader cmd; | 1085 cmds::IsShader cmd; |
947 }; | 1086 }; |
948 | 1087 |
949 Cmds expected; | 1088 Cmds expected; |
950 ExpectedMemoryInfo result1 = | 1089 ExpectedMemoryInfo result1 = |
951 GetExpectedResultMemory(sizeof(cmds::IsShader::Result)); | 1090 GetExpectedResultMemory(sizeof(cmds::IsShader::Result)); |
952 expected.cmd.Init(1, result1.id, result1.offset); | 1091 expected.cmd.Init(1, result1.id, result1.offset); |
953 | 1092 |
(...skipping 18 matching lines...) Loading... |
972 | 1111 |
973 EXPECT_CALL(*command_buffer(), OnFlush()) | 1112 EXPECT_CALL(*command_buffer(), OnFlush()) |
974 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) | 1113 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
975 .RetiresOnSaturation(); | 1114 .RetiresOnSaturation(); |
976 | 1115 |
977 GLboolean result = gl_->IsTexture(1); | 1116 GLboolean result = gl_->IsTexture(1); |
978 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1117 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
979 EXPECT_TRUE(result); | 1118 EXPECT_TRUE(result); |
980 } | 1119 } |
981 | 1120 |
| 1121 TEST_F(GLES2ImplementationTest, IsTransformFeedback) { |
| 1122 struct Cmds { |
| 1123 cmds::IsTransformFeedback cmd; |
| 1124 }; |
| 1125 |
| 1126 Cmds expected; |
| 1127 ExpectedMemoryInfo result1 = |
| 1128 GetExpectedResultMemory(sizeof(cmds::IsTransformFeedback::Result)); |
| 1129 expected.cmd.Init(1, result1.id, result1.offset); |
| 1130 |
| 1131 EXPECT_CALL(*command_buffer(), OnFlush()) |
| 1132 .WillOnce(SetMemory(result1.ptr, uint32_t(1))) |
| 1133 .RetiresOnSaturation(); |
| 1134 |
| 1135 GLboolean result = gl_->IsTransformFeedback(1); |
| 1136 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1137 EXPECT_TRUE(result); |
| 1138 } |
| 1139 |
982 TEST_F(GLES2ImplementationTest, LineWidth) { | 1140 TEST_F(GLES2ImplementationTest, LineWidth) { |
983 struct Cmds { | 1141 struct Cmds { |
984 cmds::LineWidth cmd; | 1142 cmds::LineWidth cmd; |
985 }; | 1143 }; |
986 Cmds expected; | 1144 Cmds expected; |
987 expected.cmd.Init(0.5f); | 1145 expected.cmd.Init(0.5f); |
988 | 1146 |
989 gl_->LineWidth(0.5f); | 1147 gl_->LineWidth(0.5f); |
990 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1148 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
991 } | 1149 } |
992 | 1150 |
993 TEST_F(GLES2ImplementationTest, LinkProgram) { | 1151 TEST_F(GLES2ImplementationTest, LinkProgram) { |
994 struct Cmds { | 1152 struct Cmds { |
995 cmds::LinkProgram cmd; | 1153 cmds::LinkProgram cmd; |
996 }; | 1154 }; |
997 Cmds expected; | 1155 Cmds expected; |
998 expected.cmd.Init(1); | 1156 expected.cmd.Init(1); |
999 | 1157 |
1000 gl_->LinkProgram(1); | 1158 gl_->LinkProgram(1); |
1001 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1159 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1002 } | 1160 } |
1003 | 1161 |
| 1162 TEST_F(GLES2ImplementationTest, PauseTransformFeedback) { |
| 1163 struct Cmds { |
| 1164 cmds::PauseTransformFeedback cmd; |
| 1165 }; |
| 1166 Cmds expected; |
| 1167 expected.cmd.Init(); |
| 1168 |
| 1169 gl_->PauseTransformFeedback(); |
| 1170 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1171 } |
| 1172 |
1004 TEST_F(GLES2ImplementationTest, PixelStorei) { | 1173 TEST_F(GLES2ImplementationTest, PixelStorei) { |
1005 struct Cmds { | 1174 struct Cmds { |
1006 cmds::PixelStorei cmd; | 1175 cmds::PixelStorei cmd; |
1007 }; | 1176 }; |
1008 Cmds expected; | 1177 Cmds expected; |
1009 expected.cmd.Init(GL_PACK_ALIGNMENT, 1); | 1178 expected.cmd.Init(GL_PACK_ALIGNMENT, 1); |
1010 | 1179 |
1011 gl_->PixelStorei(GL_PACK_ALIGNMENT, 1); | 1180 gl_->PixelStorei(GL_PACK_ALIGNMENT, 1); |
1012 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1181 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1013 } | 1182 } |
(...skipping 35 matching lines...) Loading... |
1049 struct Cmds { | 1218 struct Cmds { |
1050 cmds::RenderbufferStorage cmd; | 1219 cmds::RenderbufferStorage cmd; |
1051 }; | 1220 }; |
1052 Cmds expected; | 1221 Cmds expected; |
1053 expected.cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); | 1222 expected.cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); |
1054 | 1223 |
1055 gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 3, 4); | 1224 gl_->RenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 3, 4); |
1056 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1225 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1057 } | 1226 } |
1058 | 1227 |
| 1228 TEST_F(GLES2ImplementationTest, ResumeTransformFeedback) { |
| 1229 struct Cmds { |
| 1230 cmds::ResumeTransformFeedback cmd; |
| 1231 }; |
| 1232 Cmds expected; |
| 1233 expected.cmd.Init(); |
| 1234 |
| 1235 gl_->ResumeTransformFeedback(); |
| 1236 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1237 } |
| 1238 |
1059 TEST_F(GLES2ImplementationTest, SampleCoverage) { | 1239 TEST_F(GLES2ImplementationTest, SampleCoverage) { |
1060 struct Cmds { | 1240 struct Cmds { |
1061 cmds::SampleCoverage cmd; | 1241 cmds::SampleCoverage cmd; |
1062 }; | 1242 }; |
1063 Cmds expected; | 1243 Cmds expected; |
1064 expected.cmd.Init(1, true); | 1244 expected.cmd.Init(1, true); |
1065 | 1245 |
1066 gl_->SampleCoverage(1, true); | 1246 gl_->SampleCoverage(1, true); |
1067 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1247 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1068 } | 1248 } |
1069 | 1249 |
| 1250 TEST_F(GLES2ImplementationTest, SamplerParameterf) { |
| 1251 struct Cmds { |
| 1252 cmds::SamplerParameterf cmd; |
| 1253 }; |
| 1254 Cmds expected; |
| 1255 expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1256 |
| 1257 gl_->SamplerParameterf(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1258 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1259 } |
| 1260 |
| 1261 TEST_F(GLES2ImplementationTest, SamplerParameterfv) { |
| 1262 GLfloat data[1] = {0}; |
| 1263 struct Cmds { |
| 1264 cmds::SamplerParameterfvImmediate cmd; |
| 1265 GLfloat data[1]; |
| 1266 }; |
| 1267 |
| 1268 for (int jj = 0; jj < 1; ++jj) { |
| 1269 data[jj] = static_cast<GLfloat>(jj); |
| 1270 } |
| 1271 Cmds expected; |
| 1272 expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]); |
| 1273 gl_->SamplerParameterfv(1, GL_TEXTURE_MAG_FILTER, &data[0]); |
| 1274 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1275 } |
| 1276 |
| 1277 TEST_F(GLES2ImplementationTest, SamplerParameteri) { |
| 1278 struct Cmds { |
| 1279 cmds::SamplerParameteri cmd; |
| 1280 }; |
| 1281 Cmds expected; |
| 1282 expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1283 |
| 1284 gl_->SamplerParameteri(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 1285 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1286 } |
| 1287 |
| 1288 TEST_F(GLES2ImplementationTest, SamplerParameteriv) { |
| 1289 GLint data[1] = {0}; |
| 1290 struct Cmds { |
| 1291 cmds::SamplerParameterivImmediate cmd; |
| 1292 GLint data[1]; |
| 1293 }; |
| 1294 |
| 1295 for (int jj = 0; jj < 1; ++jj) { |
| 1296 data[jj] = static_cast<GLint>(jj); |
| 1297 } |
| 1298 Cmds expected; |
| 1299 expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]); |
| 1300 gl_->SamplerParameteriv(1, GL_TEXTURE_MAG_FILTER, &data[0]); |
| 1301 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 1302 } |
| 1303 |
1070 TEST_F(GLES2ImplementationTest, Scissor) { | 1304 TEST_F(GLES2ImplementationTest, Scissor) { |
1071 struct Cmds { | 1305 struct Cmds { |
1072 cmds::Scissor cmd; | 1306 cmds::Scissor cmd; |
1073 }; | 1307 }; |
1074 Cmds expected; | 1308 Cmds expected; |
1075 expected.cmd.Init(1, 2, 3, 4); | 1309 expected.cmd.Init(1, 2, 3, 4); |
1076 | 1310 |
1077 gl_->Scissor(1, 2, 3, 4); | 1311 gl_->Scissor(1, 2, 3, 4); |
1078 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 1312 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
1079 } | 1313 } |
(...skipping 1035 matching lines...) Loading... |
2115 GLuint data[2]; | 2349 GLuint data[2]; |
2116 }; | 2350 }; |
2117 Cmds expected; | 2351 Cmds expected; |
2118 expected.del.Init(arraysize(ids), &ids[0]); | 2352 expected.del.Init(arraysize(ids), &ids[0]); |
2119 expected.data[0] = kQueriesStartId; | 2353 expected.data[0] = kQueriesStartId; |
2120 expected.data[1] = kQueriesStartId + 1; | 2354 expected.data[1] = kQueriesStartId + 1; |
2121 gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]); | 2355 gl_->DeleteQueriesEXT(arraysize(ids), &ids[0]); |
2122 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2356 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2123 } | 2357 } |
2124 // TODO: Implement unit test for BeginQueryEXT | 2358 // TODO: Implement unit test for BeginQueryEXT |
| 2359 |
| 2360 TEST_F(GLES2ImplementationTest, BeginTransformFeedback) { |
| 2361 struct Cmds { |
| 2362 cmds::BeginTransformFeedback cmd; |
| 2363 }; |
| 2364 Cmds expected; |
| 2365 expected.cmd.Init(GL_POINTS); |
| 2366 |
| 2367 gl_->BeginTransformFeedback(GL_POINTS); |
| 2368 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2369 } |
| 2370 |
| 2371 TEST_F(GLES2ImplementationTest, EndTransformFeedback) { |
| 2372 struct Cmds { |
| 2373 cmds::EndTransformFeedback cmd; |
| 2374 }; |
| 2375 Cmds expected; |
| 2376 expected.cmd.Init(); |
| 2377 |
| 2378 gl_->EndTransformFeedback(); |
| 2379 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
| 2380 } |
2125 // TODO: Implement unit test for InsertEventMarkerEXT | 2381 // TODO: Implement unit test for InsertEventMarkerEXT |
2126 // TODO: Implement unit test for PushGroupMarkerEXT | 2382 // TODO: Implement unit test for PushGroupMarkerEXT |
2127 | 2383 |
2128 TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) { | 2384 TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) { |
2129 struct Cmds { | 2385 struct Cmds { |
2130 cmds::PopGroupMarkerEXT cmd; | 2386 cmds::PopGroupMarkerEXT cmd; |
2131 }; | 2387 }; |
2132 Cmds expected; | 2388 Cmds expected; |
2133 expected.cmd.Init(); | 2389 expected.cmd.Init(); |
2134 | 2390 |
(...skipping 328 matching lines...) Loading... |
2463 struct Cmds { | 2719 struct Cmds { |
2464 cmds::MatrixLoadIdentityCHROMIUM cmd; | 2720 cmds::MatrixLoadIdentityCHROMIUM cmd; |
2465 }; | 2721 }; |
2466 Cmds expected; | 2722 Cmds expected; |
2467 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); | 2723 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); |
2468 | 2724 |
2469 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 2725 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
2470 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); | 2726 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
2471 } | 2727 } |
2472 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ | 2728 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ |
OLD | NEW |