summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc14
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc4
2 files changed, 10 insertions, 8 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1824445..273df90 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5383,10 +5383,16 @@ void GLES2DecoderImpl::RestoreStateForAttrib(GLuint attrib) {
glBindBuffer(GL_ARRAY_BUFFER,
bound_array_buffer_ ? bound_array_buffer_->service_id() : 0);
- if (info->enabled()) {
- glEnableVertexAttribArray(attrib);
- } else {
- glDisableVertexAttribArray(attrib);
+ // Never touch vertex attribute 0's state (in particular, never
+ // disable it) when running on desktop GL because it will never be
+ // re-enabled.
+ if (attrib != 0 ||
+ gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) {
+ if (info->enabled()) {
+ glEnableVertexAttribArray(attrib);
+ } else {
+ glDisableVertexAttribArray(attrib);
+ }
}
}
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 ae7c768..dd73b65 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -1325,10 +1325,6 @@ void GLES2DecoderTestBase::AddExpectationsForSimulatedAttrib0WithError(
EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id))
.Times(1)
.RetiresOnSaturation();
-
- EXPECT_CALL(*gl_, DisableVertexAttribArray(0))
- .Times(1)
- .RetiresOnSaturation();
}
}