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

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

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.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));
99 } 111 }
100 112
113 TEST_F(GLES2FormatTest, BindTransformFeedback) {
114 cmds::BindTransformFeedback& cmd =
115 *GetBufferAs<cmds::BindTransformFeedback>();
116 void* next_cmd =
117 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12));
118 EXPECT_EQ(static_cast<uint32_t>(cmds::BindTransformFeedback::kCmdId),
119 cmd.header.command);
120 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
121 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
122 EXPECT_EQ(static_cast<GLuint>(12), cmd.transformfeedback);
123 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
124 }
125
101 TEST_F(GLES2FormatTest, BlendColor) { 126 TEST_F(GLES2FormatTest, BlendColor) {
102 cmds::BlendColor& cmd = *GetBufferAs<cmds::BlendColor>(); 127 cmds::BlendColor& cmd = *GetBufferAs<cmds::BlendColor>();
103 void* next_cmd = 128 void* next_cmd =
104 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLclampf>(12), 129 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLclampf>(12),
105 static_cast<GLclampf>(13), static_cast<GLclampf>(14)); 130 static_cast<GLclampf>(13), static_cast<GLclampf>(14));
106 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendColor::kCmdId), 131 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendColor::kCmdId),
107 cmd.header.command); 132 cmd.header.command);
108 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 133 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
109 EXPECT_EQ(static_cast<GLclampf>(11), cmd.red); 134 EXPECT_EQ(static_cast<GLclampf>(11), cmd.red);
110 EXPECT_EQ(static_cast<GLclampf>(12), cmd.green); 135 EXPECT_EQ(static_cast<GLclampf>(12), cmd.green);
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 cmd.header.command); 536 cmd.header.command);
512 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 537 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
513 cmd.header.size * 4u); 538 cmd.header.size * 4u);
514 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 539 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
515 CheckBytesWrittenMatchesExpectedSize( 540 CheckBytesWrittenMatchesExpectedSize(
516 next_cmd, 541 next_cmd,
517 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 542 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
518 // TODO(gman): Check that ids were inserted; 543 // TODO(gman): Check that ids were inserted;
519 } 544 }
520 545
546 TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
547 static GLuint ids[] = {
548 12, 23, 34,
549 };
550 cmds::DeleteSamplersImmediate& cmd =
551 *GetBufferAs<cmds::DeleteSamplersImmediate>();
552 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
553 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteSamplersImmediate::kCmdId),
554 cmd.header.command);
555 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
556 cmd.header.size * 4u);
557 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
558 CheckBytesWrittenMatchesExpectedSize(
559 next_cmd,
560 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
561 // TODO(gman): Check that ids were inserted;
562 }
563
521 TEST_F(GLES2FormatTest, DeleteShader) { 564 TEST_F(GLES2FormatTest, DeleteShader) {
522 cmds::DeleteShader& cmd = *GetBufferAs<cmds::DeleteShader>(); 565 cmds::DeleteShader& cmd = *GetBufferAs<cmds::DeleteShader>();
523 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11)); 566 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
524 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteShader::kCmdId), 567 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteShader::kCmdId),
525 cmd.header.command); 568 cmd.header.command);
526 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 569 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
527 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 570 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
528 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 571 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
529 } 572 }
530 573
531 TEST_F(GLES2FormatTest, DeleteTexturesImmediate) { 574 TEST_F(GLES2FormatTest, DeleteTexturesImmediate) {
532 static GLuint ids[] = { 575 static GLuint ids[] = {
533 12, 23, 34, 576 12, 23, 34,
534 }; 577 };
535 cmds::DeleteTexturesImmediate& cmd = 578 cmds::DeleteTexturesImmediate& cmd =
536 *GetBufferAs<cmds::DeleteTexturesImmediate>(); 579 *GetBufferAs<cmds::DeleteTexturesImmediate>();
537 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids); 580 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
538 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteTexturesImmediate::kCmdId), 581 EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteTexturesImmediate::kCmdId),
539 cmd.header.command); 582 cmd.header.command);
540 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 583 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
541 cmd.header.size * 4u); 584 cmd.header.size * 4u);
542 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 585 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
543 CheckBytesWrittenMatchesExpectedSize( 586 CheckBytesWrittenMatchesExpectedSize(
544 next_cmd, 587 next_cmd,
545 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 588 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
546 // TODO(gman): Check that ids were inserted; 589 // TODO(gman): Check that ids were inserted;
547 } 590 }
548 591
592 TEST_F(GLES2FormatTest, DeleteTransformFeedbacksImmediate) {
593 static GLuint ids[] = {
594 12, 23, 34,
595 };
596 cmds::DeleteTransformFeedbacksImmediate& cmd =
597 *GetBufferAs<cmds::DeleteTransformFeedbacksImmediate>();
598 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
599 EXPECT_EQ(
600 static_cast<uint32_t>(cmds::DeleteTransformFeedbacksImmediate::kCmdId),
601 cmd.header.command);
602 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
603 cmd.header.size * 4u);
604 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
605 CheckBytesWrittenMatchesExpectedSize(
606 next_cmd,
607 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
608 // TODO(gman): Check that ids were inserted;
609 }
610
549 TEST_F(GLES2FormatTest, DepthFunc) { 611 TEST_F(GLES2FormatTest, DepthFunc) {
550 cmds::DepthFunc& cmd = *GetBufferAs<cmds::DepthFunc>(); 612 cmds::DepthFunc& cmd = *GetBufferAs<cmds::DepthFunc>();
551 void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11)); 613 void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11));
552 EXPECT_EQ(static_cast<uint32_t>(cmds::DepthFunc::kCmdId), cmd.header.command); 614 EXPECT_EQ(static_cast<uint32_t>(cmds::DepthFunc::kCmdId), cmd.header.command);
553 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 615 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
554 EXPECT_EQ(static_cast<GLenum>(11), cmd.func); 616 EXPECT_EQ(static_cast<GLenum>(11), cmd.func);
555 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 617 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
556 } 618 }
557 619
558 TEST_F(GLES2FormatTest, DepthMask) { 620 TEST_F(GLES2FormatTest, DepthMask) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 cmd.header.command); 847 cmd.header.command);
786 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 848 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
787 cmd.header.size * 4u); 849 cmd.header.size * 4u);
788 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 850 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
789 CheckBytesWrittenMatchesExpectedSize( 851 CheckBytesWrittenMatchesExpectedSize(
790 next_cmd, 852 next_cmd,
791 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 853 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
792 // TODO(gman): Check that ids were inserted; 854 // TODO(gman): Check that ids were inserted;
793 } 855 }
794 856
857 TEST_F(GLES2FormatTest, GenSamplersImmediate) {
858 static GLuint ids[] = {
859 12, 23, 34,
860 };
861 cmds::GenSamplersImmediate& cmd = *GetBufferAs<cmds::GenSamplersImmediate>();
862 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
863 EXPECT_EQ(static_cast<uint32_t>(cmds::GenSamplersImmediate::kCmdId),
864 cmd.header.command);
865 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
866 cmd.header.size * 4u);
867 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
868 CheckBytesWrittenMatchesExpectedSize(
869 next_cmd,
870 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
871 // TODO(gman): Check that ids were inserted;
872 }
873
795 TEST_F(GLES2FormatTest, GenTexturesImmediate) { 874 TEST_F(GLES2FormatTest, GenTexturesImmediate) {
796 static GLuint ids[] = { 875 static GLuint ids[] = {
797 12, 23, 34, 876 12, 23, 34,
798 }; 877 };
799 cmds::GenTexturesImmediate& cmd = *GetBufferAs<cmds::GenTexturesImmediate>(); 878 cmds::GenTexturesImmediate& cmd = *GetBufferAs<cmds::GenTexturesImmediate>();
800 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids); 879 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
801 EXPECT_EQ(static_cast<uint32_t>(cmds::GenTexturesImmediate::kCmdId), 880 EXPECT_EQ(static_cast<uint32_t>(cmds::GenTexturesImmediate::kCmdId),
802 cmd.header.command); 881 cmd.header.command);
803 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u), 882 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
804 cmd.header.size * 4u); 883 cmd.header.size * 4u);
805 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n); 884 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
806 CheckBytesWrittenMatchesExpectedSize( 885 CheckBytesWrittenMatchesExpectedSize(
807 next_cmd, 886 next_cmd,
808 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u)); 887 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
809 // TODO(gman): Check that ids were inserted; 888 // TODO(gman): Check that ids were inserted;
810 } 889 }
811 890
891 TEST_F(GLES2FormatTest, GenTransformFeedbacksImmediate) {
892 static GLuint ids[] = {
893 12, 23, 34,
894 };
895 cmds::GenTransformFeedbacksImmediate& cmd =
896 *GetBufferAs<cmds::GenTransformFeedbacksImmediate>();
897 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
898 EXPECT_EQ(static_cast<uint32_t>(cmds::GenTransformFeedbacksImmediate::kCmdId),
899 cmd.header.command);
900 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
901 cmd.header.size * 4u);
902 EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
903 CheckBytesWrittenMatchesExpectedSize(
904 next_cmd,
905 sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
906 // TODO(gman): Check that ids were inserted;
907 }
908
812 TEST_F(GLES2FormatTest, GetActiveAttrib) { 909 TEST_F(GLES2FormatTest, GetActiveAttrib) {
813 cmds::GetActiveAttrib& cmd = *GetBufferAs<cmds::GetActiveAttrib>(); 910 cmds::GetActiveAttrib& cmd = *GetBufferAs<cmds::GetActiveAttrib>();
814 void* next_cmd = 911 void* next_cmd =
815 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLuint>(12), 912 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLuint>(12),
816 static_cast<uint32_t>(13), static_cast<uint32_t>(14), 913 static_cast<uint32_t>(13), static_cast<uint32_t>(14),
817 static_cast<uint32_t>(15)); 914 static_cast<uint32_t>(15));
818 EXPECT_EQ(static_cast<uint32_t>(cmds::GetActiveAttrib::kCmdId), 915 EXPECT_EQ(static_cast<uint32_t>(cmds::GetActiveAttrib::kCmdId),
819 cmd.header.command); 916 cmd.header.command);
820 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 917 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
821 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); 918 EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 EXPECT_EQ(static_cast<uint32_t>(cmds::GetRenderbufferParameteriv::kCmdId), 1110 EXPECT_EQ(static_cast<uint32_t>(cmds::GetRenderbufferParameteriv::kCmdId),
1014 cmd.header.command); 1111 cmd.header.command);
1015 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1112 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1016 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 1113 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
1017 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname); 1114 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1018 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id); 1115 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1019 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset); 1116 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1020 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1117 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1021 } 1118 }
1022 1119
1120 TEST_F(GLES2FormatTest, GetSamplerParameterfv) {
1121 cmds::GetSamplerParameterfv& cmd =
1122 *GetBufferAs<cmds::GetSamplerParameterfv>();
1123 void* next_cmd =
1124 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1125 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1126 EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameterfv::kCmdId),
1127 cmd.header.command);
1128 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1129 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1130 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1131 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1132 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1133 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1134 }
1135
1136 TEST_F(GLES2FormatTest, GetSamplerParameteriv) {
1137 cmds::GetSamplerParameteriv& cmd =
1138 *GetBufferAs<cmds::GetSamplerParameteriv>();
1139 void* next_cmd =
1140 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1141 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1142 EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameteriv::kCmdId),
1143 cmd.header.command);
1144 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1145 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1146 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1147 EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
1148 EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
1149 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1150 }
1151
1023 TEST_F(GLES2FormatTest, GetShaderiv) { 1152 TEST_F(GLES2FormatTest, GetShaderiv) {
1024 cmds::GetShaderiv& cmd = *GetBufferAs<cmds::GetShaderiv>(); 1153 cmds::GetShaderiv& cmd = *GetBufferAs<cmds::GetShaderiv>();
1025 void* next_cmd = 1154 void* next_cmd =
1026 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), 1155 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
1027 static_cast<uint32_t>(13), static_cast<uint32_t>(14)); 1156 static_cast<uint32_t>(13), static_cast<uint32_t>(14));
1028 EXPECT_EQ(static_cast<uint32_t>(cmds::GetShaderiv::kCmdId), 1157 EXPECT_EQ(static_cast<uint32_t>(cmds::GetShaderiv::kCmdId),
1029 cmd.header.command); 1158 cmd.header.command);
1030 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1159 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1031 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 1160 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
1032 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname); 1161 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)); 1460 static_cast<uint32_t>(13));
1332 EXPECT_EQ(static_cast<uint32_t>(cmds::IsRenderbuffer::kCmdId), 1461 EXPECT_EQ(static_cast<uint32_t>(cmds::IsRenderbuffer::kCmdId),
1333 cmd.header.command); 1462 cmd.header.command);
1334 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1463 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1335 EXPECT_EQ(static_cast<GLuint>(11), cmd.renderbuffer); 1464 EXPECT_EQ(static_cast<GLuint>(11), cmd.renderbuffer);
1336 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id); 1465 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1337 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset); 1466 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1338 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1467 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1339 } 1468 }
1340 1469
1470 TEST_F(GLES2FormatTest, IsSampler) {
1471 cmds::IsSampler& cmd = *GetBufferAs<cmds::IsSampler>();
1472 void* next_cmd =
1473 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1474 static_cast<uint32_t>(13));
1475 EXPECT_EQ(static_cast<uint32_t>(cmds::IsSampler::kCmdId), cmd.header.command);
1476 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1477 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1478 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1479 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1480 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1481 }
1482
1341 TEST_F(GLES2FormatTest, IsShader) { 1483 TEST_F(GLES2FormatTest, IsShader) {
1342 cmds::IsShader& cmd = *GetBufferAs<cmds::IsShader>(); 1484 cmds::IsShader& cmd = *GetBufferAs<cmds::IsShader>();
1343 void* next_cmd = 1485 void* next_cmd =
1344 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12), 1486 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1345 static_cast<uint32_t>(13)); 1487 static_cast<uint32_t>(13));
1346 EXPECT_EQ(static_cast<uint32_t>(cmds::IsShader::kCmdId), cmd.header.command); 1488 EXPECT_EQ(static_cast<uint32_t>(cmds::IsShader::kCmdId), cmd.header.command);
1347 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1489 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1348 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader); 1490 EXPECT_EQ(static_cast<GLuint>(11), cmd.shader);
1349 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id); 1491 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1350 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset); 1492 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1351 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1493 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1352 } 1494 }
1353 1495
1354 TEST_F(GLES2FormatTest, IsTexture) { 1496 TEST_F(GLES2FormatTest, IsTexture) {
1355 cmds::IsTexture& cmd = *GetBufferAs<cmds::IsTexture>(); 1497 cmds::IsTexture& cmd = *GetBufferAs<cmds::IsTexture>();
1356 void* next_cmd = 1498 void* next_cmd =
1357 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12), 1499 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1358 static_cast<uint32_t>(13)); 1500 static_cast<uint32_t>(13));
1359 EXPECT_EQ(static_cast<uint32_t>(cmds::IsTexture::kCmdId), cmd.header.command); 1501 EXPECT_EQ(static_cast<uint32_t>(cmds::IsTexture::kCmdId), cmd.header.command);
1360 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1502 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1361 EXPECT_EQ(static_cast<GLuint>(11), cmd.texture); 1503 EXPECT_EQ(static_cast<GLuint>(11), cmd.texture);
1362 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id); 1504 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1363 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset); 1505 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1364 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1506 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1365 } 1507 }
1366 1508
1509 TEST_F(GLES2FormatTest, IsTransformFeedback) {
1510 cmds::IsTransformFeedback& cmd = *GetBufferAs<cmds::IsTransformFeedback>();
1511 void* next_cmd =
1512 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
1513 static_cast<uint32_t>(13));
1514 EXPECT_EQ(static_cast<uint32_t>(cmds::IsTransformFeedback::kCmdId),
1515 cmd.header.command);
1516 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1517 EXPECT_EQ(static_cast<GLuint>(11), cmd.transformfeedback);
1518 EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
1519 EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
1520 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1521 }
1522
1367 TEST_F(GLES2FormatTest, LineWidth) { 1523 TEST_F(GLES2FormatTest, LineWidth) {
1368 cmds::LineWidth& cmd = *GetBufferAs<cmds::LineWidth>(); 1524 cmds::LineWidth& cmd = *GetBufferAs<cmds::LineWidth>();
1369 void* next_cmd = cmd.Set(&cmd, static_cast<GLfloat>(11)); 1525 void* next_cmd = cmd.Set(&cmd, static_cast<GLfloat>(11));
1370 EXPECT_EQ(static_cast<uint32_t>(cmds::LineWidth::kCmdId), cmd.header.command); 1526 EXPECT_EQ(static_cast<uint32_t>(cmds::LineWidth::kCmdId), cmd.header.command);
1371 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1527 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1372 EXPECT_EQ(static_cast<GLfloat>(11), cmd.width); 1528 EXPECT_EQ(static_cast<GLfloat>(11), cmd.width);
1373 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1529 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1374 } 1530 }
1375 1531
1376 TEST_F(GLES2FormatTest, LinkProgram) { 1532 TEST_F(GLES2FormatTest, LinkProgram) {
1377 cmds::LinkProgram& cmd = *GetBufferAs<cmds::LinkProgram>(); 1533 cmds::LinkProgram& cmd = *GetBufferAs<cmds::LinkProgram>();
1378 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11)); 1534 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
1379 EXPECT_EQ(static_cast<uint32_t>(cmds::LinkProgram::kCmdId), 1535 EXPECT_EQ(static_cast<uint32_t>(cmds::LinkProgram::kCmdId),
1380 cmd.header.command); 1536 cmd.header.command);
1381 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1537 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1382 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); 1538 EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
1383 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1539 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1384 } 1540 }
1385 1541
1542 TEST_F(GLES2FormatTest, PauseTransformFeedback) {
1543 cmds::PauseTransformFeedback& cmd =
1544 *GetBufferAs<cmds::PauseTransformFeedback>();
1545 void* next_cmd = cmd.Set(&cmd);
1546 EXPECT_EQ(static_cast<uint32_t>(cmds::PauseTransformFeedback::kCmdId),
1547 cmd.header.command);
1548 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1549 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1550 }
1551
1386 TEST_F(GLES2FormatTest, PixelStorei) { 1552 TEST_F(GLES2FormatTest, PixelStorei) {
1387 cmds::PixelStorei& cmd = *GetBufferAs<cmds::PixelStorei>(); 1553 cmds::PixelStorei& cmd = *GetBufferAs<cmds::PixelStorei>();
1388 void* next_cmd = 1554 void* next_cmd =
1389 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLint>(12)); 1555 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLint>(12));
1390 EXPECT_EQ(static_cast<uint32_t>(cmds::PixelStorei::kCmdId), 1556 EXPECT_EQ(static_cast<uint32_t>(cmds::PixelStorei::kCmdId),
1391 cmd.header.command); 1557 cmd.header.command);
1392 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1558 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1393 EXPECT_EQ(static_cast<GLenum>(11), cmd.pname); 1559 EXPECT_EQ(static_cast<GLenum>(11), cmd.pname);
1394 EXPECT_EQ(static_cast<GLint>(12), cmd.param); 1560 EXPECT_EQ(static_cast<GLint>(12), cmd.param);
1395 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1561 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 EXPECT_EQ(static_cast<uint32_t>(cmds::RenderbufferStorage::kCmdId), 1626 EXPECT_EQ(static_cast<uint32_t>(cmds::RenderbufferStorage::kCmdId),
1461 cmd.header.command); 1627 cmd.header.command);
1462 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1628 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1463 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 1629 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
1464 EXPECT_EQ(static_cast<GLenum>(12), cmd.internalformat); 1630 EXPECT_EQ(static_cast<GLenum>(12), cmd.internalformat);
1465 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width); 1631 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width);
1466 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height); 1632 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height);
1467 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1633 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1468 } 1634 }
1469 1635
1636 TEST_F(GLES2FormatTest, ResumeTransformFeedback) {
1637 cmds::ResumeTransformFeedback& cmd =
1638 *GetBufferAs<cmds::ResumeTransformFeedback>();
1639 void* next_cmd = cmd.Set(&cmd);
1640 EXPECT_EQ(static_cast<uint32_t>(cmds::ResumeTransformFeedback::kCmdId),
1641 cmd.header.command);
1642 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1643 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1644 }
1645
1470 TEST_F(GLES2FormatTest, SampleCoverage) { 1646 TEST_F(GLES2FormatTest, SampleCoverage) {
1471 cmds::SampleCoverage& cmd = *GetBufferAs<cmds::SampleCoverage>(); 1647 cmds::SampleCoverage& cmd = *GetBufferAs<cmds::SampleCoverage>();
1472 void* next_cmd = 1648 void* next_cmd =
1473 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLboolean>(12)); 1649 cmd.Set(&cmd, static_cast<GLclampf>(11), static_cast<GLboolean>(12));
1474 EXPECT_EQ(static_cast<uint32_t>(cmds::SampleCoverage::kCmdId), 1650 EXPECT_EQ(static_cast<uint32_t>(cmds::SampleCoverage::kCmdId),
1475 cmd.header.command); 1651 cmd.header.command);
1476 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1652 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1477 EXPECT_EQ(static_cast<GLclampf>(11), cmd.value); 1653 EXPECT_EQ(static_cast<GLclampf>(11), cmd.value);
1478 EXPECT_EQ(static_cast<GLboolean>(12), cmd.invert); 1654 EXPECT_EQ(static_cast<GLboolean>(12), cmd.invert);
1479 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 1655 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1480 } 1656 }
1481 1657
1658 TEST_F(GLES2FormatTest, SamplerParameterf) {
1659 cmds::SamplerParameterf& cmd = *GetBufferAs<cmds::SamplerParameterf>();
1660 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
1661 static_cast<GLenum>(12), static_cast<GLfloat>(13));
1662 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterf::kCmdId),
1663 cmd.header.command);
1664 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1665 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1666 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1667 EXPECT_EQ(static_cast<GLfloat>(13), cmd.param);
1668 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1669 }
1670
1671 TEST_F(GLES2FormatTest, SamplerParameterfvImmediate) {
1672 const int kSomeBaseValueToTestWith = 51;
1673 static GLfloat data[] = {
1674 static_cast<GLfloat>(kSomeBaseValueToTestWith + 0),
1675 };
1676 cmds::SamplerParameterfvImmediate& cmd =
1677 *GetBufferAs<cmds::SamplerParameterfvImmediate>();
1678 void* next_cmd =
1679 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
1680 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterfvImmediate::kCmdId),
1681 cmd.header.command);
1682 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
1683 cmd.header.size * 4u);
1684 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1685 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1686 CheckBytesWrittenMatchesExpectedSize(
1687 next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
1688 // TODO(gman): Check that data was inserted;
1689 }
1690
1691 TEST_F(GLES2FormatTest, SamplerParameteri) {
1692 cmds::SamplerParameteri& cmd = *GetBufferAs<cmds::SamplerParameteri>();
1693 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
1694 static_cast<GLenum>(12), static_cast<GLint>(13));
1695 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameteri::kCmdId),
1696 cmd.header.command);
1697 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1698 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1699 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1700 EXPECT_EQ(static_cast<GLint>(13), cmd.param);
1701 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
1702 }
1703
1704 TEST_F(GLES2FormatTest, SamplerParameterivImmediate) {
1705 const int kSomeBaseValueToTestWith = 51;
1706 static GLint data[] = {
1707 static_cast<GLint>(kSomeBaseValueToTestWith + 0),
1708 };
1709 cmds::SamplerParameterivImmediate& cmd =
1710 *GetBufferAs<cmds::SamplerParameterivImmediate>();
1711 void* next_cmd =
1712 cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
1713 EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterivImmediate::kCmdId),
1714 cmd.header.command);
1715 EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
1716 cmd.header.size * 4u);
1717 EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
1718 EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
1719 CheckBytesWrittenMatchesExpectedSize(
1720 next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
1721 // TODO(gman): Check that data was inserted;
1722 }
1723
1482 TEST_F(GLES2FormatTest, Scissor) { 1724 TEST_F(GLES2FormatTest, Scissor) {
1483 cmds::Scissor& cmd = *GetBufferAs<cmds::Scissor>(); 1725 cmds::Scissor& cmd = *GetBufferAs<cmds::Scissor>();
1484 void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12), 1726 void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12),
1485 static_cast<GLsizei>(13), static_cast<GLsizei>(14)); 1727 static_cast<GLsizei>(13), static_cast<GLsizei>(14));
1486 EXPECT_EQ(static_cast<uint32_t>(cmds::Scissor::kCmdId), cmd.header.command); 1728 EXPECT_EQ(static_cast<uint32_t>(cmds::Scissor::kCmdId), cmd.header.command);
1487 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 1729 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
1488 EXPECT_EQ(static_cast<GLint>(11), cmd.x); 1730 EXPECT_EQ(static_cast<GLint>(11), cmd.x);
1489 EXPECT_EQ(static_cast<GLint>(12), cmd.y); 1731 EXPECT_EQ(static_cast<GLint>(12), cmd.y);
1490 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width); 1732 EXPECT_EQ(static_cast<GLsizei>(13), cmd.width);
1491 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height); 1733 EXPECT_EQ(static_cast<GLsizei>(14), cmd.height);
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 EXPECT_EQ(static_cast<uint32_t>(cmds::BeginQueryEXT::kCmdId), 3197 EXPECT_EQ(static_cast<uint32_t>(cmds::BeginQueryEXT::kCmdId),
2956 cmd.header.command); 3198 cmd.header.command);
2957 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 3199 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
2958 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 3200 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
2959 EXPECT_EQ(static_cast<GLuint>(12), cmd.id); 3201 EXPECT_EQ(static_cast<GLuint>(12), cmd.id);
2960 EXPECT_EQ(static_cast<uint32_t>(13), cmd.sync_data_shm_id); 3202 EXPECT_EQ(static_cast<uint32_t>(13), cmd.sync_data_shm_id);
2961 EXPECT_EQ(static_cast<uint32_t>(14), cmd.sync_data_shm_offset); 3203 EXPECT_EQ(static_cast<uint32_t>(14), cmd.sync_data_shm_offset);
2962 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 3204 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
2963 } 3205 }
2964 3206
3207 TEST_F(GLES2FormatTest, BeginTransformFeedback) {
3208 cmds::BeginTransformFeedback& cmd =
3209 *GetBufferAs<cmds::BeginTransformFeedback>();
3210 void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11));
3211 EXPECT_EQ(static_cast<uint32_t>(cmds::BeginTransformFeedback::kCmdId),
3212 cmd.header.command);
3213 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
3214 EXPECT_EQ(static_cast<GLenum>(11), cmd.primitivemode);
3215 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
3216 }
3217
2965 TEST_F(GLES2FormatTest, EndQueryEXT) { 3218 TEST_F(GLES2FormatTest, EndQueryEXT) {
2966 cmds::EndQueryEXT& cmd = *GetBufferAs<cmds::EndQueryEXT>(); 3219 cmds::EndQueryEXT& cmd = *GetBufferAs<cmds::EndQueryEXT>();
2967 void* next_cmd = 3220 void* next_cmd =
2968 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12)); 3221 cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12));
2969 EXPECT_EQ(static_cast<uint32_t>(cmds::EndQueryEXT::kCmdId), 3222 EXPECT_EQ(static_cast<uint32_t>(cmds::EndQueryEXT::kCmdId),
2970 cmd.header.command); 3223 cmd.header.command);
2971 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 3224 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
2972 EXPECT_EQ(static_cast<GLenum>(11), cmd.target); 3225 EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
2973 EXPECT_EQ(static_cast<GLuint>(12), cmd.submit_count); 3226 EXPECT_EQ(static_cast<GLuint>(12), cmd.submit_count);
2974 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 3227 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
2975 } 3228 }
2976 3229
3230 TEST_F(GLES2FormatTest, EndTransformFeedback) {
3231 cmds::EndTransformFeedback& cmd = *GetBufferAs<cmds::EndTransformFeedback>();
3232 void* next_cmd = cmd.Set(&cmd);
3233 EXPECT_EQ(static_cast<uint32_t>(cmds::EndTransformFeedback::kCmdId),
3234 cmd.header.command);
3235 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
3236 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
3237 }
3238
2977 TEST_F(GLES2FormatTest, InsertEventMarkerEXT) { 3239 TEST_F(GLES2FormatTest, InsertEventMarkerEXT) {
2978 cmds::InsertEventMarkerEXT& cmd = *GetBufferAs<cmds::InsertEventMarkerEXT>(); 3240 cmds::InsertEventMarkerEXT& cmd = *GetBufferAs<cmds::InsertEventMarkerEXT>();
2979 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11)); 3241 void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
2980 EXPECT_EQ(static_cast<uint32_t>(cmds::InsertEventMarkerEXT::kCmdId), 3242 EXPECT_EQ(static_cast<uint32_t>(cmds::InsertEventMarkerEXT::kCmdId),
2981 cmd.header.command); 3243 cmd.header.command);
2982 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 3244 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
2983 EXPECT_EQ(static_cast<GLuint>(11), cmd.bucket_id); 3245 EXPECT_EQ(static_cast<GLuint>(11), cmd.bucket_id);
2984 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 3246 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
2985 } 3247 }
2986 3248
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
3919 TEST_F(GLES2FormatTest, BlendBarrierKHR) { 4181 TEST_F(GLES2FormatTest, BlendBarrierKHR) {
3920 cmds::BlendBarrierKHR& cmd = *GetBufferAs<cmds::BlendBarrierKHR>(); 4182 cmds::BlendBarrierKHR& cmd = *GetBufferAs<cmds::BlendBarrierKHR>();
3921 void* next_cmd = cmd.Set(&cmd); 4183 void* next_cmd = cmd.Set(&cmd);
3922 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendBarrierKHR::kCmdId), 4184 EXPECT_EQ(static_cast<uint32_t>(cmds::BlendBarrierKHR::kCmdId),
3923 cmd.header.command); 4185 cmd.header.command);
3924 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); 4186 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
3925 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); 4187 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
3926 } 4188 }
3927 4189
3928 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ 4190 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | gpu/command_buffer/common/gles2_cmd_ids_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698