OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
8 | 8 |
9 // This file contains unit tests for gles2 commmands | 9 // This file contains unit tests for gles2 commmands |
10 // It is included by gles2_cmd_format_test.cc | 10 // It is included by gles2_cmd_format_test.cc |
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4450 &cmd, | 4450 &cmd, |
4451 static_cast<GLuint>(11)); | 4451 static_cast<GLuint>(11)); |
4452 EXPECT_EQ(static_cast<uint32>(cmds::WaitSyncPointCHROMIUM::kCmdId), | 4452 EXPECT_EQ(static_cast<uint32>(cmds::WaitSyncPointCHROMIUM::kCmdId), |
4453 cmd.header.command); | 4453 cmd.header.command); |
4454 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 4454 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
4455 EXPECT_EQ(static_cast<GLuint>(11), cmd.sync_point); | 4455 EXPECT_EQ(static_cast<GLuint>(11), cmd.sync_point); |
4456 CheckBytesWrittenMatchesExpectedSize( | 4456 CheckBytesWrittenMatchesExpectedSize( |
4457 next_cmd, sizeof(cmd)); | 4457 next_cmd, sizeof(cmd)); |
4458 } | 4458 } |
4459 | 4459 |
| 4460 TEST_F(GLES2FormatTest, DrawBuffersEXT) { |
| 4461 cmds::DrawBuffersEXT& cmd = *GetBufferAs<cmds::DrawBuffersEXT>(); |
| 4462 void* next_cmd = cmd.Set( |
| 4463 &cmd, |
| 4464 static_cast<GLsizei>(11), |
| 4465 static_cast<uint32>(12), |
| 4466 static_cast<uint32>(13)); |
| 4467 EXPECT_EQ(static_cast<uint32>(cmds::DrawBuffersEXT::kCmdId), |
| 4468 cmd.header.command); |
| 4469 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 4470 EXPECT_EQ(static_cast<GLsizei>(11), cmd.count); |
| 4471 EXPECT_EQ(static_cast<uint32>(12), cmd.bufs_shm_id); |
| 4472 EXPECT_EQ(static_cast<uint32>(13), cmd.bufs_shm_offset); |
| 4473 CheckBytesWrittenMatchesExpectedSize( |
| 4474 next_cmd, sizeof(cmd)); |
| 4475 } |
| 4476 |
| 4477 TEST_F(GLES2FormatTest, DrawBuffersEXTImmediate) { |
| 4478 const int kSomeBaseValueToTestWith = 51; |
| 4479 static GLenum data[] = { |
| 4480 static_cast<GLenum>(kSomeBaseValueToTestWith + 0), |
| 4481 }; |
| 4482 cmds::DrawBuffersEXTImmediate& cmd = |
| 4483 *GetBufferAs<cmds::DrawBuffersEXTImmediate>(); |
| 4484 const GLsizei kNumElements = 1; |
| 4485 const size_t kExpectedCmdSize = |
| 4486 sizeof(cmd) + kNumElements * sizeof(GLenum) * 1; |
| 4487 void* next_cmd = cmd.Set( |
| 4488 &cmd, |
| 4489 static_cast<GLsizei>(1), |
| 4490 data); |
| 4491 EXPECT_EQ(static_cast<uint32>(cmds::DrawBuffersEXTImmediate::kCmdId), |
| 4492 cmd.header.command); |
| 4493 EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u); |
| 4494 EXPECT_EQ(static_cast<GLsizei>(1), cmd.count); |
| 4495 CheckBytesWrittenMatchesExpectedSize( |
| 4496 next_cmd, sizeof(cmd) + |
| 4497 RoundSizeToMultipleOfEntries(sizeof(data))); |
| 4498 // TODO(gman): Check that data was inserted; |
| 4499 } |
| 4500 |
4460 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ | 4501 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ |
4461 | 4502 |
OLD | NEW |