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

Unified Diff: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h

Issue 10635011: Add glBindUniformLocationCHROMIUM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index bc1485a94d8567005dce5c9d1c241164945355ec..7c9578964a079da6589376d79009e62f2a5d6942 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -3996,5 +3996,74 @@ TEST_F(GLES2FormatTest, ConsumeTextureCHROMIUMImmediate) {
// TODO(gman): Check that data was inserted;
}
+TEST_F(GLES2FormatTest, BindUniformLocationCHROMIUM) {
+ BindUniformLocationCHROMIUM& cmd =
+ *GetBufferAs<BindUniformLocationCHROMIUM>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLuint>(11),
+ static_cast<GLint>(12),
+ static_cast<uint32>(13),
+ static_cast<uint32>(14),
+ static_cast<uint32>(15));
+ EXPECT_EQ(static_cast<uint32>(BindUniformLocationCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.location);
+ EXPECT_EQ(static_cast<uint32>(13), cmd.name_shm_id);
+ EXPECT_EQ(static_cast<uint32>(14), cmd.name_shm_offset);
+ EXPECT_EQ(static_cast<uint32>(15), cmd.data_size);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
+
+TEST_F(GLES2FormatTest, BindUniformLocationCHROMIUMImmediate) {
+ BindUniformLocationCHROMIUMImmediate& cmd =
+ *GetBufferAs<BindUniformLocationCHROMIUMImmediate>();
+ static const char* const test_str = "test string";
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLuint>(11),
+ static_cast<GLint>(12),
+ test_str,
+ strlen(test_str));
+ EXPECT_EQ(static_cast<uint32>(BindUniformLocationCHROMIUMImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(strlen(test_str)),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<char*>(next_cmd),
+ reinterpret_cast<char*>(&cmd) + sizeof(cmd) +
+ RoundSizeToMultipleOfEntries(strlen(test_str)));
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.location);
+ EXPECT_EQ(static_cast<uint32>(strlen(test_str)), cmd.data_size);
+ EXPECT_EQ(0, memcmp(test_str, ImmediateDataAddress(&cmd), strlen(test_str)));
+ CheckBytesWritten(
+ next_cmd,
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(strlen(test_str)),
+ sizeof(cmd) + strlen(test_str));
+}
+
+TEST_F(GLES2FormatTest, BindUniformLocationCHROMIUMBucket) {
+ BindUniformLocationCHROMIUMBucket& cmd =
+ *GetBufferAs<BindUniformLocationCHROMIUMBucket>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLuint>(11),
+ static_cast<GLint>(12),
+ static_cast<uint32>(13));
+ EXPECT_EQ(static_cast<uint32>(BindUniformLocationCHROMIUMBucket::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.location);
+ EXPECT_EQ(static_cast<uint32>(13), cmd.name_bucket_id);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
« 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