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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h

Issue 788123002: Add sampler related ES3 APIs to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void* next_cmd = 79 void* next_cmd =
80 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12)); 80 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12));
81 EXPECT_EQ(static_cast<uint32_t>(cmds::BindRenderbuffer::kCmdId), 81 EXPECT_EQ(static_cast<uint32_t>(cmds::BindRenderbuffer::kCmdId),
82 cmd.header.command); 82 cmd.header.command);
83 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 83 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
84 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 84 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
85 EXPECT_EQ(static_cast<GLuint>(12), cmd.renderbuffer); 85 EXPECT_EQ(static_cast<GLuint>(12), cmd.renderbuffer);
86 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 86 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
87 } 87 }
88 88
89 TEST_F(GLES2FormatTest, BindSampler) {
90 cmds::BindSampler& cmd = *GetBufferAs<cmds::BindSampler>();
91 void* next_cmd =
92 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLuint>(12));
93 EXPECT_EQ(static_cast<uint32_t>(cmds::BindSampler::kCmdId),
94 cmd.header.command);
95 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
96 EXPECT_EQ(static_cast<GLuint>(11), cmd.unit);
97 EXPECT_EQ(static_cast<GLuint>(12), cmd.sampler);
98 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
99 }
100
89 TEST_F(GLES2FormatTest, BindTexture) { 101 TEST_F(GLES2FormatTest, BindTexture) {
90 cmds::BindTexture& cmd = *GetBufferAs<cmds::BindTexture>(); 102 cmds::BindTexture& cmd = *GetBufferAs<cmds::BindTexture>();
91 void* next_cmd = 103 void* next_cmd =
92 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12)); 104 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12));
93 EXPECT_EQ(static_cast<uint32_t>(cmds::BindTexture::kCmdId), 105 EXPECT_EQ(static_cast<uint32_t>(cmds::BindTexture::kCmdId),
94 cmd.header.command); 106 cmd.header.command);
95 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 107 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
96 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 108 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
97 EXPECT_EQ(static_cast<GLuint>(12), cmd.texture); 109 EXPECT_EQ(static_cast<GLuint>(12), cmd.texture);
98 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 110 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 cmd.header.command); 523 cmd.header.command);
512 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 524 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
513 cmd.header.size * 4u); 525 cmd.header.size * 4u);
514 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 526 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
515 CheckBytesWrittenMatchesExpectedSize( 527 CheckBytesWrittenMatchesExpectedSize(
516 next_cmd, 528 next_cmd,
517 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 529 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
518 // TODO(gman): Check that ids were inserted; 530 // TODO(gman): Check that ids were inserted;
519 } 531 }
520 532
533 TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
534 static GLuint ids[] = {
535 12, 23, 34,
536 };
537 cmds::DeleteSamplersImmediate& cmd =
538 *GetBufferAs<cmds::DeleteSamplersImmediate>();
539 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
540 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteSamplersImmediate::kCmdId),
541 cmd.header.command);
542 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
543 cmd.header.size * 4u);
544 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
545 CheckBytesWrittenMatchesExpectedSize(
546 next_cmd,
547 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
548 // TODO(gman): Check that ids were inserted;
549 }
550
521 TEST_F(GLES2FormatTest, DeleteShader) { 551 TEST_F(GLES2FormatTest, DeleteShader) {
522 cmds::DeleteShader& cmd = *GetBufferAs<cmds::DeleteShader>(); 552 cmds::DeleteShader& cmd = *GetBufferAs<cmds::DeleteShader>();
523 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11)); 553 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
524 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteShader::kCmdId), 554 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteShader::kCmdId),
525 cmd.header.command); 555 cmd.header.command);
526 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 556 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
527 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 557 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
528 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 558 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
529 } 559 }
530 560
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 cmd.header.command); 815 cmd.header.command);
786 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 816 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
787 cmd.header.size * 4u); 817 cmd.header.size * 4u);
788 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 818 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
789 CheckBytesWrittenMatchesExpectedSize( 819 CheckBytesWrittenMatchesExpectedSize(
790 next_cmd, 820 next_cmd,
791 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 821 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
792 // TODO(gman): Check that ids were inserted; 822 // TODO(gman): Check that ids were inserted;
793 } 823 }
794 824
825 TEST_F(GLES2FormatTest, GenSamplersImmediate) {
826 static GLuint ids[] = {
827 12, 23, 34,
828 };
829 cmds::GenSamplersImmediate& cmd = *GetBufferAs<cmds::GenSamplersImmediate>();
830 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
831 EXPECT_EQ(static_cast<uint32_t>(cmds::GenSamplersImmediate::kCmdId),
832 cmd.header.command);
833 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
834 cmd.header.size * 4u);
835 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
836 CheckBytesWrittenMatchesExpectedSize(
837 next_cmd,
838 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
839 // TODO(gman): Check that ids were inserted;
840 }
841
795 TEST_F(GLES2FormatTest, GenTexturesImmediate) { 842 TEST_F(GLES2FormatTest, GenTexturesImmediate) {
796 static GLuint ids[] = { 843 static GLuint ids[] = {
797 12, 23, 34, 844 12, 23, 34,
798 }; 845 };
799 cmds::GenTexturesImmediate& cmd = *GetBufferAs<cmds::GenTexturesImmediate>(); 846 cmds::GenTexturesImmediate& cmd = *GetBufferAs<cmds::GenTexturesImmediate>();
800 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids); 847 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
801 EXPECT_EQ(static_cast<uint32_t>(cmds::GenTexturesImmediate::kCmdId), 848 EXPECT_EQ(static_cast<uint32_t>(cmds::GenTexturesImmediate::kCmdId),
802 cmd.header.command); 849 cmd.header.command);
803 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 850 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
804 cmd.header.size * 4u); 851 cmd.header.size * 4u);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 EXPECT_EQ(static_cast<uint32_t>(cmds::GetRenderbufferParameteriv::kCmdId), 1060 EXPECT_EQ(static_cast<uint32_t>(cmds::GetRenderbufferParameteriv::kCmdId),
1014 cmd.header.command); 1061 cmd.header.command);
1015 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1062 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1016 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 1063 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
1017 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname); 1064 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1018 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id); 1065 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1019 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset); 1066 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1020 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1067 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1021 } 1068 }
1022 1069
1070 TEST_F(GLES2FormatTest, GetSamplerParameterfv) {
1071 cmds::GetSamplerParameterfv& cmd =
1072 *GetBufferAs<cmds::GetSamplerParameterfv>();
1073 void* next_cmd =
1074 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1075 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1076 EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameterfv::kCmdId),
1077 cmd.header.command);
1078 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1079 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1080 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1081 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1082 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1083 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1084 }
1085
1086 TEST_F(GLES2FormatTest, GetSamplerParameteriv) {
1087 cmds::GetSamplerParameteriv& cmd =
1088 *GetBufferAs<cmds::GetSamplerParameteriv>();
1089 void* next_cmd =
1090 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1091 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1092 EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameteriv::kCmdId),
1093 cmd.header.command);
1094 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1095 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1096 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1097 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1098 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1099 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1100 }
1101
1023 TEST_F(GLES2FormatTest, GetShaderiv) { 1102 TEST_F(GLES2FormatTest, GetShaderiv) {
1024 cmds::GetShaderiv& cmd = *GetBufferAs<cmds::GetShaderiv>(); 1103 cmds::GetShaderiv& cmd = *GetBufferAs<cmds::GetShaderiv>();
1025 void* next_cmd = 1104 void* next_cmd =
1026 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), 1105 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1027 static_cast<uint32_t>(13), static_cast<uint32_t>(14)); 1106 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1028 EXPECT_EQ(static_cast<uint32_t>(cmds::GetShaderiv::kCmdId), 1107 EXPECT_EQ(static_cast<uint32_t>(cmds::GetShaderiv::kCmdId),
1029 cmd.header.command); 1108 cmd.header.command);
1030 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1109 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1031 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 1110 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
1032 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname); 1111 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 static_cast<uint32_t>(13)); 1410 static_cast<uint32_t>(13));
1332 EXPECT_EQ(static_cast<uint32_t>(cmds::IsRenderbuffer::kCmdId), 1411 EXPECT_EQ(static_cast<uint32_t>(cmds::IsRenderbuffer::kCmdId),
1333 cmd.header.command); 1412 cmd.header.command);
1334 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1413 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1335 EXPECT_EQ(static_cast<GLuint>(11), cmd.renderbuffer); 1414 EXPECT_EQ(static_cast<GLuint>(11), cmd.renderbuffer);
1336 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id); 1415 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1337 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset); 1416 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1338 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1417 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1339 } 1418 }
1340 1419
1420 TEST_F(GLES2FormatTest, IsSampler) {
1421 cmds::IsSampler& cmd = *GetBufferAs<cmds::IsSampler>();
1422 void* next_cmd =
1423 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1424 static_cast<uint32_t>(13));
1425 EXPECT_EQ(static_cast<uint32_t>(cmds::IsSampler::kCmdId), cmd.header.command);
1426 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1427 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1428 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1429 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1430 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1431 }
1432
1341 TEST_F(GLES2FormatTest, IsShader) { 1433 TEST_F(GLES2FormatTest, IsShader) {
1342 cmds::IsShader& cmd = *GetBufferAs<cmds::IsShader>(); 1434 cmds::IsShader& cmd = *GetBufferAs<cmds::IsShader>();
1343 void* next_cmd = 1435 void* next_cmd =
1344 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12), 1436 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1345 static_cast<uint32_t>(13)); 1437 static_cast<uint32_t>(13));
1346 EXPECT_EQ(static_cast<uint32_t>(cmds::IsShader::kCmdId), cmd.header.command); 1438 EXPECT_EQ(static_cast<uint32_t>(cmds::IsShader::kCmdId), cmd.header.command);
1347 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1439 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1348 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 1440 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
1349 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id); 1441 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1350 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset); 1442 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 void* next_cmd = 1564 void* next_cmd =
1473 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLboolean>(12)); 1565 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLboolean>(12));
1474 EXPECT_EQ(static_cast<uint32_t>(cmds::SampleCoverage::kCmdId), 1566 EXPECT_EQ(static_cast<uint32_t>(cmds::SampleCoverage::kCmdId),
1475 cmd.header.command); 1567 cmd.header.command);
1476 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1568 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1477 EXPECT_EQ(static_cast<GLclampf>(11), cmd.value); 1569 EXPECT_EQ(static_cast<GLclampf>(11), cmd.value);
1478 EXPECT_EQ(static_cast<GLboolean>(12), cmd.invert); 1570 EXPECT_EQ(static_cast<GLboolean>(12), cmd.invert);
1479 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1571 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1480 } 1572 }
1481 1573
1574 TEST_F(GLES2FormatTest, SamplerParameterf) {
1575 cmds::SamplerParameterf& cmd = *GetBufferAs<cmds::SamplerParameterf>();
1576 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
1577 static_cast<GLenum>(12), static_cast<GLfloat>(13));
1578 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterf::kCmdId),
1579 cmd.header.command);
1580 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1581 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1582 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1583 EXPECT_EQ(static_cast<GLfloat>(13), cmd.param);
1584 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1585 }
1586
1587 TEST_F(GLES2FormatTest, SamplerParameterfvImmediate) {
1588 const int kSomeBaseValueToTestWith = 51;
1589 static GLfloat data[] = {
1590 static_cast<GLfloat>(kSomeBaseValueToTestWith + 0),
1591 };
1592 cmds::SamplerParameterfvImmediate& cmd =
1593 *GetBufferAs<cmds::SamplerParameterfvImmediate>();
1594 void* next_cmd =
1595 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
1596 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterfvImmediate::kCmdId),
1597 cmd.header.command);
1598 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
1599 cmd.header.size * 4u);
1600 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1601 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1602 CheckBytesWrittenMatchesExpectedSize(
1603 next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
1604 // TODO(gman): Check that data was inserted;
1605 }
1606
1607 TEST_F(GLES2FormatTest, SamplerParameteri) {
1608 cmds::SamplerParameteri& cmd = *GetBufferAs<cmds::SamplerParameteri>();
1609 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
1610 static_cast<GLenum>(12), static_cast<GLint>(13));
1611 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameteri::kCmdId),
1612 cmd.header.command);
1613 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1614 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1615 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1616 EXPECT_EQ(static_cast<GLint>(13), cmd.param);
1617 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1618 }
1619
1620 TEST_F(GLES2FormatTest, SamplerParameterivImmediate) {
1621 const int kSomeBaseValueToTestWith = 51;
1622 static GLint data[] = {
1623 static_cast<GLint>(kSomeBaseValueToTestWith + 0),
1624 };
1625 cmds::SamplerParameterivImmediate& cmd =
1626 *GetBufferAs<cmds::SamplerParameterivImmediate>();
1627 void* next_cmd =
1628 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
1629 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterivImmediate::kCmdId),
1630 cmd.header.command);
1631 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
1632 cmd.header.size * 4u);
1633 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1634 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1635 CheckBytesWrittenMatchesExpectedSize(
1636 next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
1637 // TODO(gman): Check that data was inserted;
1638 }
1639
1482 TEST_F(GLES2FormatTest, Scissor) { 1640 TEST_F(GLES2FormatTest, Scissor) {
1483 cmds::Scissor& cmd = *GetBufferAs<cmds::Scissor>(); 1641 cmds::Scissor& cmd = *GetBufferAs<cmds::Scissor>();
1484 void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12), 1642 void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12),
1485 static_cast<GLsizei>(13), static_cast<GLsizei>(14)); 1643 static_cast<GLsizei>(13), static_cast<GLsizei>(14));
1486 EXPECT_EQ(static_cast<uint32_t>(cmds::Scissor::kCmdId), cmd.header.command); 1644 EXPECT_EQ(static_cast<uint32_t>(cmds::Scissor::kCmdId), cmd.header.command);
1487 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1645 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1488 EXPECT_EQ(static_cast<GLint>(11), cmd.x); 1646 EXPECT_EQ(static_cast<GLint>(11), cmd.x);
1489 EXPECT_EQ(static_cast<GLint>(12), cmd.y); 1647 EXPECT_EQ(static_cast<GLint>(12), cmd.y);
1490 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width); 1648 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width);
1491 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height); 1649 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height);
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3919 TEST_F(GLES2FormatTest, BlendBarrierKHR) { 4077 TEST_F(GLES2FormatTest, BlendBarrierKHR) {
3920 cmds::BlendBarrierKHR& cmd = *GetBufferAs<cmds::BlendBarrierKHR>(); 4078 cmds::BlendBarrierKHR& cmd = *GetBufferAs<cmds::BlendBarrierKHR>();
3921 void* next_cmd = cmd.Set(&cmd); 4079 void* next_cmd = cmd.Set(&cmd);
3922 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendBarrierKHR::kCmdId), 4080 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendBarrierKHR::kCmdId),
3923 cmd.header.command); 4081 cmd.header.command);
3924 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 4082 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
3925 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 4083 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
3926 } 4084 }
3927 4085
3928 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ 4086 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698