From 0b1e9d70b3d8a9b5673d4105fb7f29afe9241d43 Mon Sep 17 00:00:00 2001 From: "enne@chromium.org" Date: Thu, 11 Nov 2010 16:29:43 +0000 Subject: 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 . 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 --- gpu/command_buffer/service/gles2_cmd_decoder.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gpu/command_buffer/service/gles2_cmd_decoder.cc') 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); -- cgit v1.1