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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest_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/client/gles2_implementation_unittest_autogen.h
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index 3d0eaa2f9efe1669dbdeb6ff8f01df558f571c4e..f501cd9b3c9286ce3078f696d11c49f415e7f29a 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -67,6 +67,28 @@ TEST_F(GLES2ImplementationTest, BindRenderbuffer) {
EXPECT_TRUE(NoCommandsWritten());
}
+TEST_F(GLES2ImplementationTest, BindSampler) {
+ struct Cmds {
+ cmds::BindSampler cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2);
+
+ gl_->BindSampler(1, 2);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, BindTransformFeedback) {
+ struct Cmds {
+ cmds::BindTransformFeedback cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(GL_TRANSFORM_FEEDBACK, 2);
+
+ gl_->BindTransformFeedback(GL_TRANSFORM_FEEDBACK, 2);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, BlendColor) {
struct Cmds {
cmds::BlendColor cmd;
@@ -312,6 +334,20 @@ TEST_F(GLES2ImplementationTest, DeleteRenderbuffers) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, DeleteSamplers) {
+ GLuint ids[2] = {kSamplersStartId, kSamplersStartId + 1};
+ struct Cmds {
+ cmds::DeleteSamplersImmediate del;
+ GLuint data[2];
+ };
+ Cmds expected;
+ expected.del.Init(arraysize(ids), &ids[0]);
+ expected.data[0] = kSamplersStartId;
+ expected.data[1] = kSamplersStartId + 1;
+ gl_->DeleteSamplers(arraysize(ids), &ids[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, DeleteShader) {
struct Cmds {
cmds::DeleteShader cmd;
@@ -337,6 +373,20 @@ TEST_F(GLES2ImplementationTest, DeleteTextures) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, DeleteTransformFeedbacks) {
+ GLuint ids[2] = {kTransformFeedbacksStartId, kTransformFeedbacksStartId + 1};
+ struct Cmds {
+ cmds::DeleteTransformFeedbacksImmediate del;
+ GLuint data[2];
+ };
+ Cmds expected;
+ expected.del.Init(arraysize(ids), &ids[0]);
+ expected.data[0] = kTransformFeedbacksStartId;
+ expected.data[1] = kTransformFeedbacksStartId + 1;
+ gl_->DeleteTransformFeedbacks(arraysize(ids), &ids[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, DepthFunc) {
struct Cmds {
cmds::DepthFunc cmd;
@@ -543,6 +593,24 @@ TEST_F(GLES2ImplementationTest, GenRenderbuffers) {
EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]);
}
+TEST_F(GLES2ImplementationTest, GenSamplers) {
+ GLuint ids[2] = {
+ 0,
+ };
+ struct Cmds {
+ cmds::GenSamplersImmediate gen;
+ GLuint data[2];
+ };
+ Cmds expected;
+ expected.gen.Init(arraysize(ids), &ids[0]);
+ expected.data[0] = kSamplersStartId;
+ expected.data[1] = kSamplersStartId + 1;
+ gl_->GenSamplers(arraysize(ids), &ids[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(kSamplersStartId, ids[0]);
+ EXPECT_EQ(kSamplersStartId + 1, ids[1]);
+}
+
TEST_F(GLES2ImplementationTest, GenTextures) {
GLuint ids[2] = {
0,
@@ -560,6 +628,24 @@ TEST_F(GLES2ImplementationTest, GenTextures) {
EXPECT_EQ(kTexturesStartId, ids[0]);
EXPECT_EQ(kTexturesStartId + 1, ids[1]);
}
+
+TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) {
+ GLuint ids[2] = {
+ 0,
+ };
+ struct Cmds {
+ cmds::GenTransformFeedbacksImmediate gen;
+ GLuint data[2];
+ };
+ Cmds expected;
+ expected.gen.Init(arraysize(ids), &ids[0]);
+ expected.data[0] = kTransformFeedbacksStartId;
+ expected.data[1] = kTransformFeedbacksStartId + 1;
+ gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(kTransformFeedbacksStartId, ids[0]);
+ EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]);
+}
// TODO: Implement unit test for GetActiveAttrib
// TODO: Implement unit test for GetActiveUniform
// TODO: Implement unit test for GetAttachedShaders
@@ -707,6 +793,40 @@ TEST_F(GLES2ImplementationTest, GetRenderbufferParameteriv) {
EXPECT_EQ(static_cast<Result::Type>(1), result);
}
+TEST_F(GLES2ImplementationTest, GetSamplerParameterfv) {
+ struct Cmds {
+ cmds::GetSamplerParameterfv cmd;
+ };
+ typedef cmds::GetSamplerParameterfv::Result Result;
+ Result::Type result = 0;
+ Cmds expected;
+ ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .RetiresOnSaturation();
+ gl_->GetSamplerParameterfv(123, GL_TEXTURE_MAG_FILTER, &result);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(static_cast<Result::Type>(1), result);
+}
+
+TEST_F(GLES2ImplementationTest, GetSamplerParameteriv) {
+ struct Cmds {
+ cmds::GetSamplerParameteriv cmd;
+ };
+ typedef cmds::GetSamplerParameteriv::Result Result;
+ Result::Type result = 0;
+ Cmds expected;
+ ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .RetiresOnSaturation();
+ gl_->GetSamplerParameteriv(123, GL_TEXTURE_MAG_FILTER, &result);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(static_cast<Result::Type>(1), result);
+}
+
TEST_F(GLES2ImplementationTest, GetShaderiv) {
struct Cmds {
cmds::GetShaderiv cmd;
@@ -941,6 +1061,25 @@ TEST_F(GLES2ImplementationTest, IsRenderbuffer) {
EXPECT_TRUE(result);
}
+TEST_F(GLES2ImplementationTest, IsSampler) {
+ struct Cmds {
+ cmds::IsSampler cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::IsSampler::Result));
+ expected.cmd.Init(1, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(1)))
+ .RetiresOnSaturation();
+
+ GLboolean result = gl_->IsSampler(1);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_TRUE(result);
+}
+
TEST_F(GLES2ImplementationTest, IsShader) {
struct Cmds {
cmds::IsShader cmd;
@@ -979,6 +1118,25 @@ TEST_F(GLES2ImplementationTest, IsTexture) {
EXPECT_TRUE(result);
}
+TEST_F(GLES2ImplementationTest, IsTransformFeedback) {
+ struct Cmds {
+ cmds::IsTransformFeedback cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::IsTransformFeedback::Result));
+ expected.cmd.Init(1, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(1)))
+ .RetiresOnSaturation();
+
+ GLboolean result = gl_->IsTransformFeedback(1);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_TRUE(result);
+}
+
TEST_F(GLES2ImplementationTest, LineWidth) {
struct Cmds {
cmds::LineWidth cmd;
@@ -1001,6 +1159,17 @@ TEST_F(GLES2ImplementationTest, LinkProgram) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, PauseTransformFeedback) {
+ struct Cmds {
+ cmds::PauseTransformFeedback cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init();
+
+ gl_->PauseTransformFeedback();
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, PixelStorei) {
struct Cmds {
cmds::PixelStorei cmd;
@@ -1056,6 +1225,17 @@ TEST_F(GLES2ImplementationTest, RenderbufferStorage) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, ResumeTransformFeedback) {
+ struct Cmds {
+ cmds::ResumeTransformFeedback cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init();
+
+ gl_->ResumeTransformFeedback();
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, SampleCoverage) {
struct Cmds {
cmds::SampleCoverage cmd;
@@ -1067,6 +1247,60 @@ TEST_F(GLES2ImplementationTest, SampleCoverage) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, SamplerParameterf) {
+ struct Cmds {
+ cmds::SamplerParameterf cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ gl_->SamplerParameterf(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameterfv) {
+ GLfloat data[1] = {0};
+ struct Cmds {
+ cmds::SamplerParameterfvImmediate cmd;
+ GLfloat data[1];
+ };
+
+ for (int jj = 0; jj < 1; ++jj) {
+ data[jj] = static_cast<GLfloat>(jj);
+ }
+ Cmds expected;
+ expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+ gl_->SamplerParameterfv(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameteri) {
+ struct Cmds {
+ cmds::SamplerParameteri cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ gl_->SamplerParameteri(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameteriv) {
+ GLint data[1] = {0};
+ struct Cmds {
+ cmds::SamplerParameterivImmediate cmd;
+ GLint data[1];
+ };
+
+ for (int jj = 0; jj < 1; ++jj) {
+ data[jj] = static_cast<GLint>(jj);
+ }
+ Cmds expected;
+ expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+ gl_->SamplerParameteriv(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, Scissor) {
struct Cmds {
cmds::Scissor cmd;
@@ -2122,6 +2356,28 @@ TEST_F(GLES2ImplementationTest, DeleteQueriesEXT) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
// TODO: Implement unit test for BeginQueryEXT
+
+TEST_F(GLES2ImplementationTest, BeginTransformFeedback) {
+ struct Cmds {
+ cmds::BeginTransformFeedback cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(GL_POINTS);
+
+ gl_->BeginTransformFeedback(GL_POINTS);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, EndTransformFeedback) {
+ struct Cmds {
+ cmds::EndTransformFeedback cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init();
+
+ gl_->EndTransformFeedback();
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
// TODO: Implement unit test for InsertEventMarkerEXT
// TODO: Implement unit test for PushGroupMarkerEXT
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/client/gles2_interface_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698