summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-29 20:50:57 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-29 20:50:57 +0000
commit26a764f8cb5452493c53a5b80f1b2cfa2bae4585 (patch)
treefd17cf35c4521a77f48289f35e6e4ae4f186351b /gpu
parentbbc4912ddf6663cf88a469a2f271786829a273db (diff)
downloadchromium_src-26a764f8cb5452493c53a5b80f1b2cfa2bae4585.zip
chromium_src-26a764f8cb5452493c53a5b80f1b2cfa2bae4585.tar.gz
chromium_src-26a764f8cb5452493c53a5b80f1b2cfa2bae4585.tar.bz2
Disable GL_EXT_texture_storage support in Linux.
Our implementation is not compatible with newer Nvidia driver versions. This should be reenabled when a workaround is found. BUG=107782 TEST=see bug report for manual test (linux only) Review URL: http://codereview.chromium.org/8989064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/feature_info.cc35
-rw-r--r--gpu/command_buffer/service/test_helper.cc5
2 files changed, 37 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 7bee2a8..0d836d9 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <set>
-#include <string>
#include "gpu/command_buffer/service/feature_info.h"
+
+#include <set>
+
+#include "base/string_number_conversions.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
@@ -411,7 +413,34 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
validators_.texture_parameter.AddValue(GL_TEXTURE_USAGE_ANGLE);
}
- if (ext.HaveAndDesire("GL_EXT_texture_storage")) {
+ bool allow_texture_storage = true;
+#if defined(OS_LINUX)
+ if (!disallowed_features_.driver_bug_workarounds) {
+ // Disable GL_EXT_texture_storage on Linux, newer Nvidia drivers
+ // don't support our implementation. See crbug.com/107782. The bug is
+ // present on 285.x.x but not on 280.x.x so we will disable this feature
+ // on driver versions greater than 280.
+ const char* vendor_str =
+ reinterpret_cast<const char*>(glGetString(GL_VENDOR));
+ bool is_nvidia = vendor_str &&
+ (strcmp(vendor_str, "NVIDIA Corporation") == 0);
+ if (is_nvidia) {
+ base::StringPiece version =
+ reinterpret_cast<const char*>(glGetString(GL_VERSION));
+ int version_num = 0;
+ size_t begin_version = version.find_last_of(' ') + 1;
+ size_t size_version = version.find_first_of('.', begin_version) -
+ begin_version;
+ if (base::StringToInt(version.substr(begin_version, size_version),
+ &version_num))
+ allow_texture_storage = (version_num <= 280);
+ else
+ allow_texture_storage = false;
+ }
+ }
+#endif
+
+ if (allow_texture_storage && ext.HaveAndDesire("GL_EXT_texture_storage")) {
AddExtensionString("GL_EXT_texture_storage");
validators_.texture_parameter.AddValue(GL_TEXTURE_IMMUTABLE_FORMAT_EXT);
if (enable_texture_format_bgra8888)
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
index 0290980..d4628a9 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -221,6 +221,11 @@ void TestHelper::SetupFeatureInfoInitExpectations(
EXPECT_CALL(*gl, GetString(GL_EXTENSIONS))
.WillOnce(Return(reinterpret_cast<const uint8*>(extensions)))
.RetiresOnSaturation();
+#if defined(OS_LINUX)
+ EXPECT_CALL(*gl, GetString(GL_VENDOR))
+ .WillOnce(Return(reinterpret_cast<const uint8*>(extensions)))
+ .RetiresOnSaturation();
+#endif
}
} // namespace gles2