Commit 1e54ddbe authored by Sean Gilhuly's avatar Sean Gilhuly Committed by Commit Bot

Reland "Replace GPU Compositing feature with GL"

This reverts commit baefa2e4.

Reason for revert: Fixed the failing tests. In my refactor I removed a check to
gpu_feature_info_.IsInitialized(), which would cause an issue during fallback if
the gpu info was not ready yet.

Original change's description:
> Revert "Replace GPU Compositing feature with GL"
>
> This reverts commit 8834f5a3.
>
> Reason for revert: Likely culprit for consistent failure on Linux FYI Debug (NVIDIA): both GpuProcess_swiftshader_for_webgl and GpuProcess_feature_status_under_swiftshader fail DCHECK(gpu_feature_info_.IsInitialized())
>
> Original change's description:
> > Replace GPU Compositing feature with GL
> >
> > GPU compositing is never specifically blacklisted in
> > software_rendering_list.json, only when all are disabled, so remove it,
> > and add GPU_FEATURE_TYPE_GL. Use this as a proxy for GPU compositing for
> > now. This will need to be fixed to support the case where GL is
> > blacklisted, but Vulkan is still enabled.
> >
> > Bug: 1005383
> > Change-Id: I0330021cfa59c6c4cf2719785f7931e53ec50f80
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917753
> > Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
> > Reviewed-by: Zhenyao Mo <zmo@chromium.org>
> > Reviewed-by: kylechar <kylechar@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#719399}
>
> TBR=zmo@chromium.org,kylechar@chromium.org,sgilhuly@chromium.org
>
> Change-Id: I65f801a3d790f864367101cbaabc7991308ffe03
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1005383
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1940172
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#719608}

Change-Id: I0247a230dc074a7425bcd2cbfd25d1fb41322db1
Bug: 1005383
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1940884Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Reviewed-by: default avatarSean Gilhuly <sgilhuly@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Auto-Submit: Sean Gilhuly <sgilhuly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720039}
parent 6f717758
...@@ -269,7 +269,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -269,7 +269,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
if (gpu_channel_host && if (gpu_channel_host &&
gpu_channel_host->gpu_feature_info() gpu_channel_host->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] != .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_GL] !=
gpu::kGpuFeatureStatusEnabled) { gpu::kGpuFeatureStatusEnabled) {
use_gpu_compositing = false; use_gpu_compositing = false;
} }
...@@ -785,7 +785,7 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() { ...@@ -785,7 +785,7 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
gpu_channel_factory_->EstablishGpuChannelSync(); gpu_channel_factory_->EstablishGpuChannelSync();
if (!gpu_channel_host || if (!gpu_channel_host ||
gpu_channel_host->gpu_feature_info() gpu_channel_host->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] != .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_GL] !=
gpu::kGpuFeatureStatusEnabled) { gpu::kGpuFeatureStatusEnabled) {
DisableGpuCompositing(nullptr); DisableGpuCompositing(nullptr);
if (gpu_channel_host) if (gpu_channel_host)
......
...@@ -404,8 +404,10 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing( ...@@ -404,8 +404,10 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(
const auto& gpu_feature_info = gpu_channel_host->gpu_feature_info(); const auto& gpu_feature_info = gpu_channel_host->gpu_feature_info();
// Fallback to software compositing if GPU compositing is blacklisted. // Fallback to software compositing if GPU compositing is blacklisted.
// TODO(sgilhuly): For now assume that if GL is blacklisted, then Vulkan is
// also. Just check GL to see if GPU compositing is disabled.
auto gpu_compositing_status = auto gpu_compositing_status =
gpu_feature_info.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING]; gpu_feature_info.status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_GL];
if (gpu_compositing_status != gpu::kGpuFeatureStatusEnabled) if (gpu_compositing_status != gpu::kGpuFeatureStatusEnabled)
return gpu::ContextResult::kFatalFailure; return gpu::ContextResult::kFatalFailure;
......
...@@ -89,12 +89,6 @@ gpu::GpuFeatureStatus SafeGetFeatureStatus( ...@@ -89,12 +89,6 @@ gpu::GpuFeatureStatus SafeGetFeatureStatus(
return gpu_feature_info.status_values[feature]; return gpu_feature_info.status_values[feature];
} }
gpu::GpuFeatureStatus GetGpuCompositingStatus(
const gpu::GpuFeatureInfo& gpu_feature_info) {
return SafeGetFeatureStatus(gpu_feature_info,
gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING);
}
const GpuFeatureData GetGpuFeatureData( const GpuFeatureData GetGpuFeatureData(
const gpu::GpuFeatureInfo& gpu_feature_info, const gpu::GpuFeatureInfo& gpu_feature_info,
size_t index, size_t index,
...@@ -111,8 +105,14 @@ const GpuFeatureData GetGpuFeatureData( ...@@ -111,8 +105,14 @@ const GpuFeatureData GetGpuFeatureData(
"Accelerated 2D canvas is unavailable: either disabled " "Accelerated 2D canvas is unavailable: either disabled "
"via blacklist or the command line."), "via blacklist or the command line."),
true}, true},
{"gpu_compositing", GetGpuCompositingStatus(gpu_feature_info), {"gpu_compositing",
command_line.HasSwitch(switches::kDisableGpuCompositing), // TODO(sgilhuly): Replace with a check to see which backend is used for
// compositing; do the same for GPU rasterization if it's enabled. For now
// assume that if GL is blacklisted, then Vulkan is also. Check GL to see
// if GPU compositing is disabled.
SafeGetFeatureStatus(gpu_feature_info,
gpu::GPU_FEATURE_TYPE_ACCELERATED_GL),
GpuDataManagerImpl::GetInstance()->IsGpuCompositingDisabled(),
DisableInfo::Problem( DisableInfo::Problem(
"Gpu compositing has been disabled, either via blacklist, about:flags " "Gpu compositing has been disabled, either via blacklist, about:flags "
"or the command line. The browser will fall back to software " "or the command line. The browser will fall back to software "
...@@ -176,6 +176,11 @@ const GpuFeatureData GetGpuFeatureData( ...@@ -176,6 +176,11 @@ const GpuFeatureData GetGpuFeatureData(
gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION), gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION),
command_line.HasSwitch(switches::kDisableOopRasterization), command_line.HasSwitch(switches::kDisableOopRasterization),
DisableInfo::NotProblem(), false}, DisableInfo::NotProblem(), false},
{"opengl",
SafeGetFeatureStatus(gpu_feature_info,
gpu::GPU_FEATURE_TYPE_ACCELERATED_GL),
false /* disabled */, DisableInfo::NotProblem(),
false /* fallback_to_software */},
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
{"metal", {"metal",
SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_METAL), SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_METAL),
...@@ -261,8 +266,7 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl( ...@@ -261,8 +266,7 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl(
status = "enabled"; status = "enabled";
if ((gpu_feature_data.name == "webgl" || if ((gpu_feature_data.name == "webgl" ||
gpu_feature_data.name == "webgl2") && gpu_feature_data.name == "webgl2") &&
(GetGpuCompositingStatus(gpu_feature_info) != manager->IsGpuCompositingDisabled())
gpu::kGpuFeatureStatusEnabled))
status += "_readback"; status += "_readback";
if (gpu_feature_data.name == "rasterization") { if (gpu_feature_data.name == "rasterization") {
if (IsForceGpuRasterizationEnabled()) if (IsForceGpuRasterizationEnabled())
...@@ -275,7 +279,8 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl( ...@@ -275,7 +279,8 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl(
status += "_force"; status += "_force";
status += "_on"; status += "_on";
} }
if (gpu_feature_data.name == "metal" || if (gpu_feature_data.name == "opengl" ||
gpu_feature_data.name == "metal" ||
gpu_feature_data.name == "vulkan" || gpu_feature_data.name == "vulkan" ||
gpu_feature_data.name == "surface_control") { gpu_feature_data.name == "surface_control") {
status += "_on"; status += "_on";
......
...@@ -141,7 +141,7 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) { ...@@ -141,7 +141,7 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) {
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
const gpu::GpuFeatureType kGpuFeatures[] = { const gpu::GpuFeatureType kGpuFeatures[] = {
gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS,
gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, gpu::GPU_FEATURE_TYPE_ACCELERATED_GL,
gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION, gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION,
gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION, gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION,
gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
...@@ -615,10 +615,6 @@ void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo( ...@@ -615,10 +615,6 @@ void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo(
const base::Optional<gpu::GpuFeatureInfo>& const base::Optional<gpu::GpuFeatureInfo>&
gpu_feature_info_for_hardware_gpu) { gpu_feature_info_for_hardware_gpu) {
gpu_feature_info_ = gpu_feature_info; gpu_feature_info_ = gpu_feature_info;
if (IsGpuCompositingDisabled()) {
gpu_feature_info_.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] =
gpu::kGpuFeatureStatusDisabled;
}
if (!gpu_feature_info_for_hardware_gpu_.IsInitialized()) { if (!gpu_feature_info_for_hardware_gpu_.IsInitialized()) {
if (gpu_feature_info_for_hardware_gpu.has_value()) { if (gpu_feature_info_for_hardware_gpu.has_value()) {
DCHECK(gpu_feature_info_for_hardware_gpu->IsInitialized()); DCHECK(gpu_feature_info_for_hardware_gpu->IsInitialized());
...@@ -658,14 +654,10 @@ bool GpuDataManagerImplPrivate::IsGpuCompositingDisabled() const { ...@@ -658,14 +654,10 @@ bool GpuDataManagerImplPrivate::IsGpuCompositingDisabled() const {
} }
void GpuDataManagerImplPrivate::SetGpuCompositingDisabled() { void GpuDataManagerImplPrivate::SetGpuCompositingDisabled() {
disable_gpu_compositing_ = true; if (!IsGpuCompositingDisabled()) {
disable_gpu_compositing_ = true;
if (gpu_feature_info_.IsInitialized() && if (gpu_feature_info_.IsInitialized())
gpu_feature_info_.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] == NotifyGpuInfoUpdate();
gpu::kGpuFeatureStatusEnabled) {
gpu_feature_info_.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] =
gpu::kGpuFeatureStatusDisabled;
NotifyGpuInfoUpdate();
} }
} }
......
...@@ -161,7 +161,8 @@ const GpuControlList::More kMoreForEntry5_572251052Exception0 = { ...@@ -161,7 +161,8 @@ const GpuControlList::More kMoreForEntry5_572251052Exception0 = {
const int kFeatureListForGpuManagerTestingEntry6[14] = { const int kFeatureListForGpuManagerTestingEntry6[14] = {
GPU_FEATURE_TYPE_FLASH_STAGE3D, GPU_FEATURE_TYPE_FLASH_STAGE3D,
GPU_FEATURE_TYPE_GPU_COMPOSITING, GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL,
GPU_FEATURE_TYPE_ACCELERATED_GL,
GPU_FEATURE_TYPE_GPU_RASTERIZATION, GPU_FEATURE_TYPE_GPU_RASTERIZATION,
GPU_FEATURE_TYPE_FLASH3D, GPU_FEATURE_TYPE_FLASH3D,
GPU_FEATURE_TYPE_METAL, GPU_FEATURE_TYPE_METAL,
...@@ -170,7 +171,6 @@ const int kFeatureListForGpuManagerTestingEntry6[14] = { ...@@ -170,7 +171,6 @@ const int kFeatureListForGpuManagerTestingEntry6[14] = {
GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE, GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE,
GPU_FEATURE_TYPE_OOP_RASTERIZATION, GPU_FEATURE_TYPE_OOP_RASTERIZATION,
GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE, GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE,
GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL,
GPU_FEATURE_TYPE_ACCELERATED_WEBGL, GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
GPU_FEATURE_TYPE_VULKAN, GPU_FEATURE_TYPE_VULKAN,
GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE, GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE,
......
...@@ -253,6 +253,7 @@ cr.define('gpu', function() { ...@@ -253,6 +253,7 @@ cr.define('gpu', function() {
'video_decode': 'Video Decode', 'video_decode': 'Video Decode',
'rasterization': 'Rasterization', 'rasterization': 'Rasterization',
'oop_rasterization': 'Out-of-process Rasterization', 'oop_rasterization': 'Out-of-process Rasterization',
'opengl': 'OpenGL',
'metal': 'Metal', 'metal': 'Metal',
'vulkan': 'Vulkan', 'vulkan': 'Vulkan',
'multiple_raster_threads': 'Multiple Raster Threads', 'multiple_raster_threads': 'Multiple Raster Threads',
......
...@@ -281,7 +281,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest): ...@@ -281,7 +281,7 @@ class GpuProcessIntegrationTest(gpu_integration_test.GpuIntegrationTest):
def _GpuProcess_readback_webgl_gpu_process(self, test_path): def _GpuProcess_readback_webgl_gpu_process(self, test_path):
# Hit test group 1 with entry 152 from kSoftwareRenderingListEntries. # Hit test group 1 with entry 152 from kSoftwareRenderingListEntries.
self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([ self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([
'--gpu-blacklist-test-group=1'])) '--gpu-blacklist-test-group=1', '--disable-gpu-compositing']))
self._Navigate(test_path) self._Navigate(test_path)
feature_status_list = self.tab.EvaluateJavaScript( feature_status_list = self.tab.EvaluateJavaScript(
'browserBridge.gpuInfo.featureStatus.featureStatus') 'browserBridge.gpuInfo.featureStatus.featureStatus')
......
...@@ -27,8 +27,6 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create( ...@@ -27,8 +27,6 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create(
std::unique_ptr<GpuBlocklist> list(new GpuBlocklist(data)); std::unique_ptr<GpuBlocklist> list(new GpuBlocklist(data));
list->AddSupportedFeature("accelerated_2d_canvas", list->AddSupportedFeature("accelerated_2d_canvas",
GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS);
list->AddSupportedFeature("gpu_compositing",
GPU_FEATURE_TYPE_GPU_COMPOSITING);
list->AddSupportedFeature("accelerated_webgl", list->AddSupportedFeature("accelerated_webgl",
GPU_FEATURE_TYPE_ACCELERATED_WEBGL); GPU_FEATURE_TYPE_ACCELERATED_WEBGL);
list->AddSupportedFeature("flash3d", GPU_FEATURE_TYPE_FLASH3D); list->AddSupportedFeature("flash3d", GPU_FEATURE_TYPE_FLASH3D);
...@@ -47,6 +45,7 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create( ...@@ -47,6 +45,7 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create(
GPU_FEATURE_TYPE_OOP_RASTERIZATION); GPU_FEATURE_TYPE_OOP_RASTERIZATION);
list->AddSupportedFeature("android_surface_control", list->AddSupportedFeature("android_surface_control",
GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL); GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL);
list->AddSupportedFeature("accelerated_gl", GPU_FEATURE_TYPE_ACCELERATED_GL);
list->AddSupportedFeature("metal", GPU_FEATURE_TYPE_METAL); list->AddSupportedFeature("metal", GPU_FEATURE_TYPE_METAL);
list->AddSupportedFeature("vulkan", GPU_FEATURE_TYPE_VULKAN); list->AddSupportedFeature("vulkan", GPU_FEATURE_TYPE_VULKAN);
return list; return list;
......
...@@ -83,8 +83,6 @@ class GpuBlocklistTest : public testing::Test { ...@@ -83,8 +83,6 @@ class GpuBlocklistTest : public testing::Test {
GPU_BLOCKLIST_FEATURE_TEST(Accelerated2DCanvas, GPU_BLOCKLIST_FEATURE_TEST(Accelerated2DCanvas,
GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)
GPU_BLOCKLIST_FEATURE_TEST(GpuCompositing, GPU_FEATURE_TYPE_GPU_COMPOSITING)
GPU_BLOCKLIST_FEATURE_TEST(AcceleratedWebGL, GPU_FEATURE_TYPE_ACCELERATED_WEBGL) GPU_BLOCKLIST_FEATURE_TEST(AcceleratedWebGL, GPU_FEATURE_TYPE_ACCELERATED_WEBGL)
GPU_BLOCKLIST_FEATURE_TEST(Flash3D, GPU_FEATURE_TYPE_FLASH3D) GPU_BLOCKLIST_FEATURE_TEST(Flash3D, GPU_FEATURE_TYPE_FLASH3D)
...@@ -106,6 +104,10 @@ GPU_BLOCKLIST_FEATURE_TEST(WebGL2, GPU_FEATURE_TYPE_ACCELERATED_WEBGL2) ...@@ -106,6 +104,10 @@ GPU_BLOCKLIST_FEATURE_TEST(WebGL2, GPU_FEATURE_TYPE_ACCELERATED_WEBGL2)
GPU_BLOCKLIST_FEATURE_TEST(ProtectedVideoDecode, GPU_BLOCKLIST_FEATURE_TEST(ProtectedVideoDecode,
GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE) GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE)
GPU_BLOCKLIST_FEATURE_TEST(GL, GPU_FEATURE_TYPE_ACCELERATED_GL)
GPU_BLOCKLIST_FEATURE_TEST(Vulkan, GPU_FEATURE_TYPE_VULKAN)
// Test for invariant "Assume the newly last added entry has the largest ID". // Test for invariant "Assume the newly last added entry has the largest ID".
// See GpuControlList::GpuControlList. // See GpuControlList::GpuControlList.
// It checks software_rendering_list.json // It checks software_rendering_list.json
......
...@@ -50,7 +50,7 @@ bool GpuFeatureInfo::IsWorkaroundEnabled(int32_t workaround) const { ...@@ -50,7 +50,7 @@ bool GpuFeatureInfo::IsWorkaroundEnabled(int32_t workaround) const {
bool GpuFeatureInfo::IsInitialized() const { bool GpuFeatureInfo::IsInitialized() const {
// Check if any feature status is undefined. // Check if any feature status is undefined.
return status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] != return status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] !=
kGpuFeatureStatusUndefined; kGpuFeatureStatusUndefined;
} }
......
...@@ -12,7 +12,6 @@ namespace gpu { ...@@ -12,7 +12,6 @@ namespace gpu {
// If a bit is set to 1, corresponding feature is blacklisted. // If a bit is set to 1, corresponding feature is blacklisted.
enum GpuFeatureType { enum GpuFeatureType {
GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS = 0, GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS = 0,
GPU_FEATURE_TYPE_GPU_COMPOSITING,
GPU_FEATURE_TYPE_ACCELERATED_WEBGL, GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
GPU_FEATURE_TYPE_FLASH3D, GPU_FEATURE_TYPE_FLASH3D,
GPU_FEATURE_TYPE_FLASH_STAGE3D, GPU_FEATURE_TYPE_FLASH_STAGE3D,
...@@ -23,6 +22,7 @@ enum GpuFeatureType { ...@@ -23,6 +22,7 @@ enum GpuFeatureType {
GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE, GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE,
GPU_FEATURE_TYPE_OOP_RASTERIZATION, GPU_FEATURE_TYPE_OOP_RASTERIZATION,
GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL, GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL,
GPU_FEATURE_TYPE_ACCELERATED_GL,
GPU_FEATURE_TYPE_METAL, GPU_FEATURE_TYPE_METAL,
GPU_FEATURE_TYPE_VULKAN, GPU_FEATURE_TYPE_VULKAN,
NUMBER_OF_GPU_FEATURE_TYPES NUMBER_OF_GPU_FEATURE_TYPES
......
...@@ -237,15 +237,14 @@ GpuFeatureStatus GetAcceleratedVideoDecodeFeatureStatus( ...@@ -237,15 +237,14 @@ GpuFeatureStatus GetAcceleratedVideoDecodeFeatureStatus(
return kGpuFeatureStatusEnabled; return kGpuFeatureStatusEnabled;
} }
GpuFeatureStatus GetGpuCompositingFeatureStatus( GpuFeatureStatus GetGLFeatureStatus(const std::set<int>& blacklisted_features,
const std::set<int>& blacklisted_features, bool use_swift_shader) {
bool use_swift_shader) {
if (use_swift_shader) { if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated // This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver. // path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled; return kGpuFeatureStatusEnabled;
} }
if (blacklisted_features.count(GPU_FEATURE_TYPE_GPU_COMPOSITING)) if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_GL))
return kGpuFeatureStatusBlacklisted; return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled; return kGpuFeatureStatusEnabled;
} }
...@@ -308,8 +307,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() { ...@@ -308,8 +307,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
GpuFeatureInfo gpu_feature_info; GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware; kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware; kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
...@@ -330,6 +327,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() { ...@@ -330,6 +327,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
...@@ -346,8 +345,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() { ...@@ -346,8 +345,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
GpuFeatureInfo gpu_feature_info; GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware; kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
...@@ -368,6 +365,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() { ...@@ -368,6 +365,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
...@@ -384,8 +383,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() { ...@@ -384,8 +383,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
GpuFeatureInfo gpu_feature_info; GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware; kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware; kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
...@@ -406,6 +403,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() { ...@@ -406,6 +403,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled; kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
...@@ -478,8 +477,6 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info, ...@@ -478,8 +477,6 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
GetAcceleratedVideoDecodeFeatureStatus(blacklisted_features, GetAcceleratedVideoDecodeFeatureStatus(blacklisted_features,
use_swift_shader); use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
GetGpuCompositingFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE] =
GetProtectedVideoDecodeFeatureStatus(blacklisted_features, gpu_info, GetProtectedVideoDecodeFeatureStatus(blacklisted_features, gpu_info,
use_swift_shader); use_swift_shader);
...@@ -489,6 +486,8 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info, ...@@ -489,6 +486,8 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
GetAndroidSurfaceControlFeatureStatus(blacklisted_features, GetAndroidSurfaceControlFeatureStatus(blacklisted_features,
gpu_preferences); gpu_preferences);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
GetGLFeatureStatus(blacklisted_features, use_swift_shader);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
GetMetalFeatureStatus(blacklisted_features, gpu_preferences); GetMetalFeatureStatus(blacklisted_features, gpu_preferences);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] = gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
...@@ -663,13 +662,14 @@ bool EnableSwiftShaderIfNeeded(base::CommandLine* command_line, ...@@ -663,13 +662,14 @@ bool EnableSwiftShaderIfNeeded(base::CommandLine* command_line,
bool disable_software_rasterizer, bool disable_software_rasterizer,
bool blacklist_needs_more_info) { bool blacklist_needs_more_info) {
#if BUILDFLAG(ENABLE_SWIFTSHADER) #if BUILDFLAG(ENABLE_SWIFTSHADER)
if (disable_software_rasterizer) if (disable_software_rasterizer || blacklist_needs_more_info)
return false; return false;
// Don't overwrite user preference. // Don't overwrite user preference.
if (command_line->HasSwitch(switches::kUseGL)) if (command_line->HasSwitch(switches::kUseGL))
return false; return false;
if (!blacklist_needs_more_info && if (gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] !=
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] != kGpuFeatureStatusEnabled ||
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] !=
kGpuFeatureStatusEnabled) { kGpuFeatureStatusEnabled) {
command_line->AppendSwitchASCII( command_line->AppendSwitchASCII(
switches::kUseGL, gl::kGLImplementationSwiftShaderForWebGLName); switches::kUseGL, gl::kGLImplementationSwiftShaderForWebGLName);
......
...@@ -1587,6 +1587,7 @@ ...@@ -1587,6 +1587,7 @@
"features": [ "features": [
"all", "all",
{"exceptions": [ {"exceptions": [
"accelerated_gl",
"accelerated_webgl" "accelerated_webgl"
]} ]}
] ]
......
...@@ -360,8 +360,8 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, ...@@ -360,8 +360,8 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
} else { // use_swiftshader == true } else { // use_swiftshader == true
switch (gpu_preferences_.use_vulkan) { switch (gpu_preferences_.use_vulkan) {
case gpu::VulkanImplementationName::kNative: { case gpu::VulkanImplementationName::kNative: {
// Collect GPU info, so we can use backlist to disable vulkan if it is // Collect GPU info, so we can use blacklist to disable vulkan if it
// needed. // is needed.
gpu::GPUInfo gpu_info; gpu::GPUInfo gpu_info;
if (!CollectGraphicsInfo(&gpu_info, gpu_preferences_)) if (!CollectGraphicsInfo(&gpu_info, gpu_preferences_))
return false; return false;
......
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