summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorvmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 21:36:11 +0000
committervmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 21:36:11 +0000
commit242c982192615a10912025281326c9b189a8bb9c (patch)
tree889a8c031822f4213716a637c6dc0185c71bce38 /gpu
parent040a734e276f6e6311de3edbbe7d42196183c0d8 (diff)
downloadchromium_src-242c982192615a10912025281326c9b189a8bb9c.zip
chromium_src-242c982192615a10912025281326c9b189a8bb9c.tar.gz
chromium_src-242c982192615a10912025281326c9b189a8bb9c.tar.bz2
glDeleteVertexArraysOES on bound VAO restores default VAO 0.
The default VAO attributes were not being restored when using emulated VAO, for example on ARM GPUs (e.g. Nexus 10) Chrome forces VAO emulation, and the following WebGL conformance test fails: http://www.khronos.org/registry/webgl/sdk/tests/conformance/extensions/oes-vertex-array-object.html BUG=263398 Review URL: https://codereview.chromium.org/237603003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc2
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc23
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc6
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h1
4 files changed, 31 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 80ca209..9a5cb1a 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9631,7 +9631,7 @@ void GLES2DecoderImpl::DeleteVertexArraysOESHelper(
GetVertexAttribManager(client_ids[ii]);
if (vao && !vao->IsDeleted()) {
if (state_.vertex_attrib_manager.get() == vao) {
- state_.vertex_attrib_manager = default_vertex_attrib_manager_;
+ DoBindVertexArrayOES(0);
}
RemoveVertexAttribManager(client_ids[ii]);
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 016bfab..19b7292 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -7706,6 +7706,20 @@ class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest {
ExecuteImmediateCmd(cmd, sizeof(temp)));
}
+ void DeleteBoundVertexArraysOESImmediateValidArgs() {
+ BindVertexArrayOESValidArgs();
+
+ AddExpectationsForDeleteBoundVertexArraysOES();
+ DeleteVertexArraysOESImmediate& cmd =
+ *GetImmediateAs<DeleteVertexArraysOESImmediate>();
+ cmd.Init(1, &client_vertexarray_id_);
+ EXPECT_EQ(error::kNoError,
+ ExecuteImmediateCmd(cmd, sizeof(client_vertexarray_id_)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ EXPECT_TRUE(GetVertexArrayInfo(client_vertexarray_id_) == NULL);
+ vertex_array_deleted_manually_ = true;
+ }
+
void IsVertexArrayOESValidArgs() {
IsVertexArrayOES cmd;
cmd.Init(client_vertexarray_id_, shared_memory_id_, shared_memory_offset_);
@@ -7824,6 +7838,15 @@ TEST_F(GLES2DecoderEmulatedVertexArraysOESTest,
DeleteVertexArraysOESImmediateInvalidArgs();
}
+TEST_F(GLES2DecoderVertexArraysOESTest,
+ DeleteBoundVertexArraysOESImmediateValidArgs) {
+ DeleteBoundVertexArraysOESImmediateValidArgs();
+}
+TEST_F(GLES2DecoderEmulatedVertexArraysOESTest,
+ DeleteBoundVertexArraysOESImmediateValidArgs) {
+ DeleteBoundVertexArraysOESImmediateValidArgs();
+}
+
TEST_F(GLES2DecoderVertexArraysOESTest, IsVertexArrayOESValidArgs) {
IsVertexArrayOESValidArgs();
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index eb4eb9c..f644c89 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -987,6 +987,12 @@ void GLES2DecoderTestBase::AddExpectationsForDeleteVertexArraysOES(){
}
}
+void GLES2DecoderTestBase::AddExpectationsForDeleteBoundVertexArraysOES() {
+ // Expectations are the same as a delete, followed by binding VAO 0.
+ AddExpectationsForDeleteVertexArraysOES();
+ AddExpectationsForBindVertexArrayOES();
+}
+
void GLES2DecoderTestBase::AddExpectationsForBindVertexArrayOES() {
if (group_->feature_info()->feature_flags().native_vertex_array_object) {
EXPECT_CALL(*gl_, BindVertexArrayOES(_))
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 24a960e..52e7211 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -354,6 +354,7 @@ class GLES2DecoderTestBase : public testing::Test {
void AddExpectationsForGenVertexArraysOES();
void AddExpectationsForDeleteVertexArraysOES();
+ void AddExpectationsForDeleteBoundVertexArraysOES();
void AddExpectationsForBindVertexArrayOES();
void AddExpectationsForRestoreAttribState(GLuint attrib);