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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest_autogen.h

Issue 795243002: Add TransformFeedback related APIs to command buffer: PART I. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 360bfc42e8560717c250dfe73e789f44ba74b9f8..f501cd9b3c9286ce3078f696d11c49f415e7f29a 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -78,6 +78,17 @@ TEST_F(GLES2ImplementationTest, BindSampler) {
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;
@@ -362,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;
@@ -603,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
@@ -1075,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;
@@ -1097,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;
@@ -1152,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;
@@ -2272,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

Powered by Google App Engine
This is Rietveld 408576698