Commit cc1732e0 authored by Kenneth Russell's avatar Kenneth Russell Committed by Commit Bot

Re-enable EXT_disjoint_timer_query WebGL extensions on desktop.

Site Isolation has shipped there so it is safe to expose this
extension again.

Improve the GPU test logs to include the disabled extensions and
WebGL extensions, to reduce confusion.

Bug: 820891
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: I404bcab474046d90f82d9ba6d042fb3eaaf394bd
Reviewed-on: https://chromium-review.googlesource.com/1147872
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarKai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579125}
parent ce9513fa
......@@ -17,6 +17,7 @@
#include "base/metrics/field_trial.h"
#include "base/numerics/ranges.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/sys_info.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
......@@ -338,6 +339,25 @@ std::vector<std::string> GetDriverBugWorkaroundsImpl(GpuFeatureInfoType type) {
workarounds.push_back(gpu::GpuDriverBugWorkaroundTypeToString(
static_cast<gpu::GpuDriverBugWorkaroundType>(workaround)));
}
// Tell clients about the disabled extensions and disabled WebGL
// extensions as well, to avoid confusion. Do this in a way that's
// compatible with the current reporting of driver bug workarounds
// to DevTools and Telemetry, and from there to the GPU tests.
//
// This code must be kept in sync with
// GpuBenchmarking::GetGpuDriverBugWorkarounds.
for (auto ext : base::SplitString(gpu_feature_info.disabled_extensions,
" ",
base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY)) {
workarounds.push_back("disabled_extension_" + ext);
}
for (auto ext : base::SplitString(gpu_feature_info.disabled_webgl_extensions,
" ",
base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY)) {
workarounds.push_back("disabled_webgl_extension_" + ext);
}
return workarounds;
}
......
......@@ -1085,14 +1085,31 @@ void GpuBenchmarking::GetGpuDriverBugWorkarounds(gin::Arguments* args) {
RenderThreadImpl::current()->GetGpuChannel();
if (!gpu_channel)
return;
const gpu::GpuFeatureInfo& gpu_feature_info =
gpu_channel->gpu_feature_info();
const std::vector<int32_t>& workarounds =
gpu_channel->gpu_feature_info().enabled_gpu_driver_bug_workarounds;
gpu_feature_info.enabled_gpu_driver_bug_workarounds;
for (int32_t workaround : workarounds) {
gpu_driver_bug_workarounds.push_back(
gpu::GpuDriverBugWorkaroundTypeToString(
static_cast<gpu::GpuDriverBugWorkaroundType>(workaround)));
}
// This code must be kept in sync with compositor_util's
// GetDriverBugWorkaroundsImpl.
for (auto ext : base::SplitString(gpu_feature_info.disabled_extensions,
" ",
base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY)) {
gpu_driver_bug_workarounds.push_back("disabled_extension_" + ext);
}
for (auto ext : base::SplitString(gpu_feature_info.disabled_webgl_extensions,
" ",
base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY)) {
gpu_driver_bug_workarounds.push_back("disabled_webgl_extension_" + ext);
}
v8::Local<v8::Value> result;
if (gin::TryConvertToV8(args->isolate(), gpu_driver_bug_workarounds, &result))
args->Return(result);
......
......@@ -167,6 +167,17 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
(sys.platform.startswith('linux') and
not self._RunningOnAndroid()))
@staticmethod
def _Filterer(workaround):
# Filter all entries starting with "disabled_extension_" and
# "disabled_webgl_extension_", as these are synthetic entries
# added to make it easier to read the logs.
banned_prefixes = ['disabled_extension_', 'disabled_webgl_extension_']
for p in banned_prefixes:
if workaround.startswith(p):
return False
return True
def _CompareAndCaptureDriverBugWorkarounds(self):
tab = self.tab
if not tab.EvaluateJavaScript('chrome.gpuBenchmarking.hasGpuProcess()'):
......@@ -175,14 +186,16 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
if not tab.EvaluateJavaScript('chrome.gpuBenchmarking.hasGpuChannel()'):
self.fail('No GPU channel detected')
browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
gpu_list = tab.EvaluateJavaScript(
'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
browser_list = [
x for x in tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
if self._Filterer(x)]
gpu_list = [
x for x in tab.EvaluateJavaScript(
'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
if self._Filterer(x)]
diff = set(browser_list).symmetric_difference(set(gpu_list))
if len(diff) > 0:
print 'Test failed. Printing page contents:'
print tab.EvaluateJavaScript('document.body.innerHTML')
self.fail('Browser and GPU process list of driver bug'
'workarounds are not equal: %s != %s, diff: %s' %
(browser_list, gpu_list, list(diff)))
......
......@@ -29,13 +29,15 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
['win', 'mac', 'linux'])
self.Skip('WebglExtension_WEBGL_compressed_texture_s3tc_srgb',
['win', 'mac', 'linux'])
self.Skip('WebglExtension_EXT_disjoint_timer_query_webgl2', bug=808744)
self.Skip('WebglExtension_WEBGL_multiview',
['mac', 'linux', 'android'], bug=864524)
# The multiview extension is only expected to be supported through ANGLE.
self.Skip('WebglExtension_WEBGL_multiview',
['win', 'no_passthrough'], bug=864524)
self.Skip('WebglExtension_EXT_disjoint_timer_query_webgl2',
['android'], bug=808744)
self.Fail('WebglExtension_EXT_disjoint_timer_query_webgl2',
['linux', 'intel'], bug=867675)
# ========================
# Conformance expectations
......
......@@ -55,15 +55,16 @@ class WebGLConformanceExpectations(GpuTestExpectations):
['win', 'mac', 'linux'])
self.Skip('WebglExtension_WEBGL_compressed_texture_s3tc_srgb',
['win', 'mac', 'linux', 'android'])
self.Skip('WebglExtension_EXT_disjoint_timer_query', bug=808744)
self.Skip('WebglExtension_EXT_disjoint_timer_query',
['android'], bug=808744)
# Extensions not available under D3D9
self.Fail('WebglExtension_EXT_sRGB',
['win', 'd3d9'])
self.Fail('WebglExtension_EXT_disjoint_timer_query',
['win', 'd3d9'], bug=867718)
self.Fail('WebglExtension_WEBGL_depth_texture',
['win', 'amd', 'd3d9'])
self.Fail('WebglExtension_WEBGL_draw_buffers',
['win', 'd3d9'])
......
......@@ -2738,8 +2738,11 @@
},
{
"id": 256,
"description": "Don't expose disjoint_timer_query extensions to WebGL",
"description": "Don't expose disjoint_timer_query extensions to WebGL unless site isolation is enabled",
"cr_bugs": [808744],
"os": {
"type": "android"
},
"disabled_webgl_extensions": [
"EXT_disjoint_timer_query",
"EXT_disjoint_timer_query_webgl2"
......
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