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

Unified 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 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 49c108c622c0c6a04b421fddc718a8caae88780c..ca810477507d9e85491fd618908642ccb5c79772 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -86,6 +86,18 @@ TEST_F(GLES2FormatTest, BindRenderbuffer) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, BindSampler) {
+ cmds::BindSampler& cmd = *GetBufferAs<cmds::BindSampler>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLuint>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::BindSampler::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.unit);
+ EXPECT_EQ(static_cast<GLuint>(12), cmd.sampler);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, BindTexture) {
cmds::BindTexture& cmd = *GetBufferAs<cmds::BindTexture>();
void* next_cmd =
@@ -98,6 +110,19 @@ TEST_F(GLES2FormatTest, BindTexture) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, BindTransformFeedback) {
+ cmds::BindTransformFeedback& cmd =
+ *GetBufferAs<cmds::BindTransformFeedback>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLuint>(12));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::BindTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<GLuint>(12), cmd.transformfeedback);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, BlendColor) {
cmds::BlendColor& cmd = *GetBufferAs<cmds::BlendColor>();
void* next_cmd =
@@ -518,6 +543,24 @@ TEST_F(GLES2FormatTest, DeleteRenderbuffersImmediate) {
// TODO(gman): Check that ids were inserted;
}
+TEST_F(GLES2FormatTest, DeleteSamplersImmediate) {
+ static GLuint ids[] = {
+ 12, 23, 34,
+ };
+ cmds::DeleteSamplersImmediate& cmd =
+ *GetBufferAs<cmds::DeleteSamplersImmediate>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::DeleteSamplersImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd,
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
+ // TODO(gman): Check that ids were inserted;
+}
+
TEST_F(GLES2FormatTest, DeleteShader) {
cmds::DeleteShader& cmd = *GetBufferAs<cmds::DeleteShader>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
@@ -546,6 +589,25 @@ TEST_F(GLES2FormatTest, DeleteTexturesImmediate) {
// TODO(gman): Check that ids were inserted;
}
+TEST_F(GLES2FormatTest, DeleteTransformFeedbacksImmediate) {
+ static GLuint ids[] = {
+ 12, 23, 34,
+ };
+ cmds::DeleteTransformFeedbacksImmediate& cmd =
+ *GetBufferAs<cmds::DeleteTransformFeedbacksImmediate>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
+ EXPECT_EQ(
+ static_cast<uint32_t>(cmds::DeleteTransformFeedbacksImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd,
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
+ // TODO(gman): Check that ids were inserted;
+}
+
TEST_F(GLES2FormatTest, DepthFunc) {
cmds::DepthFunc& cmd = *GetBufferAs<cmds::DepthFunc>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11));
@@ -792,6 +854,23 @@ TEST_F(GLES2FormatTest, GenRenderbuffersImmediate) {
// TODO(gman): Check that ids were inserted;
}
+TEST_F(GLES2FormatTest, GenSamplersImmediate) {
+ static GLuint ids[] = {
+ 12, 23, 34,
+ };
+ cmds::GenSamplersImmediate& cmd = *GetBufferAs<cmds::GenSamplersImmediate>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GenSamplersImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd,
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
+ // TODO(gman): Check that ids were inserted;
+}
+
TEST_F(GLES2FormatTest, GenTexturesImmediate) {
static GLuint ids[] = {
12, 23, 34,
@@ -809,6 +888,24 @@ TEST_F(GLES2FormatTest, GenTexturesImmediate) {
// TODO(gman): Check that ids were inserted;
}
+TEST_F(GLES2FormatTest, GenTransformFeedbacksImmediate) {
+ static GLuint ids[] = {
+ 12, 23, 34,
+ };
+ cmds::GenTransformFeedbacksImmediate& cmd =
+ *GetBufferAs<cmds::GenTransformFeedbacksImmediate>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(arraysize(ids)), ids);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GenTransformFeedbacksImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(cmd.n * 4u),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLsizei>(arraysize(ids)), cmd.n);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd,
+ sizeof(cmd) + RoundSizeToMultipleOfEntries(arraysize(ids) * 4u));
+ // TODO(gman): Check that ids were inserted;
+}
+
TEST_F(GLES2FormatTest, GetActiveAttrib) {
cmds::GetActiveAttrib& cmd = *GetBufferAs<cmds::GetActiveAttrib>();
void* next_cmd =
@@ -1020,6 +1117,38 @@ TEST_F(GLES2FormatTest, GetRenderbufferParameteriv) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, GetSamplerParameterfv) {
+ cmds::GetSamplerParameterfv& cmd =
+ *GetBufferAs<cmds::GetSamplerParameterfv>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
+ static_cast<uint32_t>(13), static_cast<uint32_t>(14));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameterfv::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, GetSamplerParameteriv) {
+ cmds::GetSamplerParameteriv& cmd =
+ *GetBufferAs<cmds::GetSamplerParameteriv>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12),
+ static_cast<uint32_t>(13), static_cast<uint32_t>(14));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetSamplerParameteriv::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.params_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, GetShaderiv) {
cmds::GetShaderiv& cmd = *GetBufferAs<cmds::GetShaderiv>();
void* next_cmd =
@@ -1338,6 +1467,19 @@ TEST_F(GLES2FormatTest, IsRenderbuffer) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, IsSampler) {
+ cmds::IsSampler& cmd = *GetBufferAs<cmds::IsSampler>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::IsSampler::kCmdId), cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, IsShader) {
cmds::IsShader& cmd = *GetBufferAs<cmds::IsShader>();
void* next_cmd =
@@ -1364,6 +1506,20 @@ TEST_F(GLES2FormatTest, IsTexture) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, IsTransformFeedback) {
+ cmds::IsTransformFeedback& cmd = *GetBufferAs<cmds::IsTransformFeedback>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::IsTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.transformfeedback);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.result_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.result_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, LineWidth) {
cmds::LineWidth& cmd = *GetBufferAs<cmds::LineWidth>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLfloat>(11));
@@ -1383,6 +1539,16 @@ TEST_F(GLES2FormatTest, LinkProgram) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, PauseTransformFeedback) {
+ cmds::PauseTransformFeedback& cmd =
+ *GetBufferAs<cmds::PauseTransformFeedback>();
+ void* next_cmd = cmd.Set(&cmd);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::PauseTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, PixelStorei) {
cmds::PixelStorei& cmd = *GetBufferAs<cmds::PixelStorei>();
void* next_cmd =
@@ -1467,6 +1633,16 @@ TEST_F(GLES2FormatTest, RenderbufferStorage) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, ResumeTransformFeedback) {
+ cmds::ResumeTransformFeedback& cmd =
+ *GetBufferAs<cmds::ResumeTransformFeedback>();
+ void* next_cmd = cmd.Set(&cmd);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::ResumeTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, SampleCoverage) {
cmds::SampleCoverage& cmd = *GetBufferAs<cmds::SampleCoverage>();
void* next_cmd =
@@ -1479,6 +1655,72 @@ TEST_F(GLES2FormatTest, SampleCoverage) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, SamplerParameterf) {
+ cmds::SamplerParameterf& cmd = *GetBufferAs<cmds::SamplerParameterf>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<GLfloat>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterf::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<GLfloat>(13), cmd.param);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, SamplerParameterfvImmediate) {
+ const int kSomeBaseValueToTestWith = 51;
+ static GLfloat data[] = {
+ static_cast<GLfloat>(kSomeBaseValueToTestWith + 0),
+ };
+ cmds::SamplerParameterfvImmediate& cmd =
+ *GetBufferAs<cmds::SamplerParameterfvImmediate>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterfvImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
+ // TODO(gman): Check that data was inserted;
+}
+
+TEST_F(GLES2FormatTest, SamplerParameteri) {
+ cmds::SamplerParameteri& cmd = *GetBufferAs<cmds::SamplerParameteri>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11),
+ static_cast<GLenum>(12), static_cast<GLint>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameteri::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ EXPECT_EQ(static_cast<GLint>(13), cmd.param);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
+TEST_F(GLES2FormatTest, SamplerParameterivImmediate) {
+ const int kSomeBaseValueToTestWith = 51;
+ static GLint data[] = {
+ static_cast<GLint>(kSomeBaseValueToTestWith + 0),
+ };
+ cmds::SamplerParameterivImmediate& cmd =
+ *GetBufferAs<cmds::SamplerParameterivImmediate>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLenum>(12), data);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::SamplerParameterivImmediate::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)),
+ cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sampler);
+ EXPECT_EQ(static_cast<GLenum>(12), cmd.pname);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data)));
+ // TODO(gman): Check that data was inserted;
+}
+
TEST_F(GLES2FormatTest, Scissor) {
cmds::Scissor& cmd = *GetBufferAs<cmds::Scissor>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12),
@@ -2962,6 +3204,17 @@ TEST_F(GLES2FormatTest, BeginQueryEXT) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, BeginTransformFeedback) {
+ cmds::BeginTransformFeedback& cmd =
+ *GetBufferAs<cmds::BeginTransformFeedback>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::BeginTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.primitivemode);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, EndQueryEXT) {
cmds::EndQueryEXT& cmd = *GetBufferAs<cmds::EndQueryEXT>();
void* next_cmd =
@@ -2974,6 +3227,15 @@ TEST_F(GLES2FormatTest, EndQueryEXT) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, EndTransformFeedback) {
+ cmds::EndTransformFeedback& cmd = *GetBufferAs<cmds::EndTransformFeedback>();
+ void* next_cmd = cmd.Set(&cmd);
+ EXPECT_EQ(static_cast<uint32_t>(cmds::EndTransformFeedback::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, InsertEventMarkerEXT) {
cmds::InsertEventMarkerEXT& cmd = *GetBufferAs<cmds::InsertEventMarkerEXT>();
void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11));
« 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