summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 01:03:14 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 01:03:14 +0000
commit265f8990b909b7e1e21079c66275b5ca5182436d (patch)
treeeee56bd22a12042dc14c5a3b6364372a22fb7b5d /gpu
parent491e60d36afad9da800569d8546ec1f06b273299 (diff)
downloadchromium_src-265f8990b909b7e1e21079c66275b5ca5182436d.zip
chromium_src-265f8990b909b7e1e21079c66275b5ca5182436d.tar.gz
chromium_src-265f8990b909b7e1e21079c66275b5ca5182436d.tar.bz2
On desktop GL, don't disable vertex attribute 0 when restoring state, or nothing will be drawn during subsequent draw calls.
BUG=138088 TEST=gpu_unittests; revised WebGL conformance test gl-vertex-attrib-zero-issues.html (will be pulled to GPU bots); test cases from bug report Review URL: https://chromiumcodereview.appspot.com/10808041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147584 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-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();
}
}