summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 16:29:43 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 16:29:43 +0000
commit0b1e9d70b3d8a9b5673d4105fb7f29afe9241d43 (patch)
treed30c3ea34cacbfc9287308029fe74aea6a438b20 /gpu/command_buffer
parent56a95e06ead71623bf0ec12ae0fb231946d7b9bc (diff)
downloadchromium_src-0b1e9d70b3d8a9b5673d4105fb7f29afe9241d43.zip
chromium_src-0b1e9d70b3d8a9b5673d4105fb7f29afe9241d43.tar.gz
chromium_src-0b1e9d70b3d8a9b5673d4105fb7f29afe9241d43.tar.bz2
Handle GL errors when querying the multisample count.
I believe this bug can only be triggered when there is a corresponding OpenGL bug. However, the i915 driver has this bug. Patch from Kenneth Waters <kwaters@chromium.org>. TEST=built and run against broken i915 driver BUG=none Review URL: http://codereview.chromium.org/4710002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1723c27e..110ea12 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1800,7 +1800,9 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context,
(context_->HasExtension("GL_EXT_framebuffer_multisample") ||
context_->HasExtension("GL_ANGLE_framebuffer_multisample"))) {
// Per ext_framebuffer_multisample spec, need max bound on sample count.
- GLint max_sample_count;
+ // max_sample_count must be initialized to a sane value. If
+ // glGetIntegerv() throws a GL error, it leaves its argument unchanged.
+ GLint max_sample_count = 1;
glGetIntegerv(GL_MAX_SAMPLES_EXT, &max_sample_count);
offscreen_target_samples_ = std::min(attrib_parser.samples_,
max_sample_count);