Commit 03ecd12f authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Clean up some GPU info collection code/documentation nits.

BUG=839609,839618
TEST=gl_unittests
R=kbr@chromium.org
NOTRY=true

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I45f30195cf09ec973b45c8c0da0eee4a2b8ceec8
Reviewed-on: https://chromium-review.googlesource.com/1069261
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560784}
parent 5ebecd9a
...@@ -68,9 +68,10 @@ ...@@ -68,9 +68,10 @@
// to 0, which is Chrome's blacklist. Any entries with a non-zero test_group // to 0, which is Chrome's blacklist. Any entries with a non-zero test_group
// ID will be applied if Chrome runs with --gpu-blacklist-test-group=ID. // ID will be applied if Chrome runs with --gpu-blacklist-test-group=ID.
// 29. "gpu_series" is a list of gpu series names. Currently supported series // 29. "gpu_series" is a list of gpu series names. Currently supported series
// include: "intel_ivybridge", "intel_sandybridge", "intel_haswell", // include: "intel_sandybridge", "intel_valleyview", "intel_ivybridge",
// "intel_broadwell", "intel_skylake", "intel_kabylake", "intel_coffeelake", // "intel_haswell", "intel_cherryview", "intel_broadwell",
// "intel_cherryview". // "intel_apollolake", "intel_skylake", "intel_geminilake",
// "intel_kabylake", "intel_coffeelake".
// //
// VERSION includes "op", "style", "value", and "value2". "op" can be any of // VERSION includes "op", "style", "value", and "value2". "op" can be any of
// the following values: "=", "<", "<=", ">", ">=", "any", "between". "style" // the following values: "=", "<", "<=", ">", ">=", "any", "between". "style"
......
...@@ -87,11 +87,15 @@ void GLVersionInfo::ParseVersionString(const char* version_str) { ...@@ -87,11 +87,15 @@ void GLVersionInfo::ParseVersionString(const char* version_str) {
return; return;
} }
DCHECK_LE(3u, pieces[0].size()); // At lease major.minor if (is_es) {
if (pieces[0][pieces[0].size() - 1] == 'V') { // Desktop GL doesn't specify the GL_VERSION format, but ES spec requires
// On Nexus 6 with Android N, GL_VERSION string is not spec conformant. // the string to be in the format of "OpenGL ES major.minor other_info".
// There is no space between "3.1" and "V@104.0". DCHECK_LE(3u, pieces[0].size());
pieces[0].remove_suffix(1); if (pieces[0][pieces[0].size() - 1] == 'V') {
// On Nexus 6 with Android N, GL_VERSION string is not spec compliant.
// There is no space between "3.1" and "V@104.0".
pieces[0].remove_suffix(1);
}
} }
std::string gl_version; std::string gl_version;
pieces[0].CopyToString(&gl_version); pieces[0].CopyToString(&gl_version);
......
...@@ -52,7 +52,9 @@ TEST(GLVersionInfoTest, ParseGLVersionStringTest) { ...@@ -52,7 +52,9 @@ TEST(GLVersionInfoTest, ParseGLVersionStringTest) {
{"4.5.14008 Compatibility Profile Context 21.19.137.514", 4, 5, false, {"4.5.14008 Compatibility Profile Context 21.19.137.514", 4, 5, false,
false, false, "", "21.19.137.514"}, false, false, "", "21.19.137.514"},
{"4.5.13497 Compatibility Profile/Debug Context 23.20.782.0", 4, 5, false, {"4.5.13497 Compatibility Profile/Debug Context 23.20.782.0", 4, 5, false,
false, false, "", "23.20.782.0"}}; false, false, "", "23.20.782.0"},
// This is a non spec compliant string from Nexus6 on Android N.
{"OpenGL ES 3.1V@104.0", 3, 1, true, false, true, "", "104.0"}};
ExtensionSet extensions; ExtensionSet extensions;
for (size_t ii = 0; ii < base::size(kTestData); ++ii) { for (size_t ii = 0; ii < base::size(kTestData); ++ii) {
GLVersionInfo version_info(kTestData[ii].gl_version, nullptr, extensions); GLVersionInfo version_info(kTestData[ii].gl_version, nullptr, extensions);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment