Commit 65579d42 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Revert "[Fuchsia] Disable fallback to SW compositing."

This reverts commit 34173c24.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [Fuchsia] Disable fallback to SW compositing.
> 
> Previously WebEngine was falling back to SW compositing after 3
> GPU process crashes. This is not desirable when Vulkan is enabled
> because it may mask other issues. Also not all features work correctly
> with SW compositing (e.g. it's not compatible with HW video decoder).
> 
> Also added --disable-software-rasterizer to disable SwiftShader as
> we should never need to use it on Fuchsia.
> 
> Bug: 1021844
> Change-Id: I3257d9f0372789849a2922b514e6b23e08a380e0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854893
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Reviewed-by: Jonathan Backer <backer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#713063}

TBR=backer@chromium.org,wez@chromium.org,sergeyu@chromium.org

Change-Id: Ie22e4f3afcbf204dbdaf03f34ebb33254be51c0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1021844
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900663Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713080}
parent 62b16000
......@@ -966,12 +966,10 @@ gpu::GpuMode GpuDataManagerImplPrivate::GetGpuMode() const {
}
void GpuDataManagerImplPrivate::FallBackToNextGpuMode() {
#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_FUCHSIA)
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
// Android and Chrome OS can't switch to software compositing. If the GPU
// process initialization fails or GPU process is too unstable then crash the
// browser process to reset everything.
// On Fuchsia Vulkan must be used when it's enabled by the WebEngine embedder.
// Falling back to SW compositing in that case is not supported.
#if defined(OS_ANDROID)
FatalGpuProcessLaunchFailureOnBackground();
#endif
......
......@@ -247,20 +247,14 @@ void ContextProviderImpl::Create(
}
if (enable_vulkan) {
DLOG(ERROR) << "Enabling Vulkan GPU acceleration.";
launch_command.AppendSwitch(switches::kUseVulkan);
launch_command.AppendSwitchASCII(switches::kEnableFeatures,
features::kUseSkiaRenderer.name);
launch_command.AppendSwitch(switches::kEnableOopRasterization);
launch_command.AppendSwitch(switches::kDisableSoftwareRasterizer);
launch_command.AppendSwitchASCII(switches::kUseGL,
gl::kGLImplementationStubName);
launch_command.AppendSwitchASCII(switches::kGrContextType,
switches::kGrContextTypeVulkan);
} else {
DLOG(ERROR) << "Disabling GPU acceleration.";
launch_command.AppendSwitch(switches::kDisableGpu);
launch_command.AppendSwitch(switches::kDisableSoftwareRasterizer);
}
if (enable_widevine) {
......
......@@ -28,20 +28,6 @@ buildflag_header("buildflags") {
visibility = [ ":*" ]
}
# TODO(https://crbug.com/1021844): Remove this hack once we have Vulkan
# emulation available via AEMU.
source_set("detect_vulkan_hack") {
sources = [
"common/detect_vulkan_hack.cc",
"common/detect_vulkan_hack.h",
]
deps = [
"//gpu/vulkan",
"//third_party/fuchsia-sdk/sdk:web",
]
visibility = [ ":*" ]
}
# Files common to both cast_runner and web_runner targets.
source_set("common") {
sources = [
......@@ -106,7 +92,6 @@ executable("cast_runner_exe") {
":buildflags",
":cast_runner_core",
":common",
":detect_vulkan_hack",
"//base",
"//fuchsia/base",
]
......@@ -221,7 +206,6 @@ executable("web_runner_exe") {
]
deps = [
":common",
":detect_vulkan_hack",
"//base",
"//fuchsia/base",
]
......
......@@ -13,7 +13,6 @@
#include "fuchsia/base/init_logging.h"
#include "fuchsia/runners/buildflags.h"
#include "fuchsia/runners/cast/cast_runner.h"
#include "fuchsia/runners/common/detect_vulkan_hack.h"
int main(int argc, char** argv) {
base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO);
......@@ -32,9 +31,6 @@ int main(int argc, char** argv) {
fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER |
fuchsia::web::ContextFeatureFlags::WIDEVINE_CDM;
// Vulkan is not currently available in our integration test environment.
DisableVulkanIfUnavailable(&features);
if (!BUILDFLAG(ENABLE_SOFTWARE_VIDEO_DECODERS))
features |= fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER_ONLY;
......
include_rules = [
"+gpu/vulkan",
]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "fuchsia/runners/common/detect_vulkan_hack.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
// Removes the VULKAN feature flag if Vulkan is not available on the host.
void DisableVulkanIfUnavailable(fuchsia::web::ContextFeatureFlags* features) {
gpu::VulkanFunctionPointers* vulkan_ptrs = gpu::GetVulkanFunctionPointers();
if (!vulkan_ptrs->BindUnassociatedFunctionPointers())
*features &= ~fuchsia::web::ContextFeatureFlags::VULKAN;
}
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FUCHSIA_RUNNERS_COMMON_DETECT_VULKAN_HACK_H_
#define FUCHSIA_RUNNERS_COMMON_DETECT_VULKAN_HACK_H_
#include <fuchsia/web/cpp/fidl.h>
// Removes the VULKAN feature flag if Vulkan is not available on the host.
// TODO(https://crbug.com/1021844): Remove this workaround once our test
// environment provides Vulkan.
void DisableVulkanIfUnavailable(fuchsia::web::ContextFeatureFlags* features);
#endif // FUCHSIA_RUNNERS_COMMON_DETECT_VULKAN_HACK_H_
......@@ -10,7 +10,6 @@
#include "base/run_loop.h"
#include "base/task/single_thread_task_executor.h"
#include "fuchsia/base/init_logging.h"
#include "fuchsia/runners/common/detect_vulkan_hack.h"
#include "fuchsia/runners/common/web_content_runner.h"
int main(int argc, char** argv) {
......@@ -23,19 +22,17 @@ int main(int argc, char** argv) {
return 1;
}
fuchsia::web::ContextFeatureFlags features =
constexpr fuchsia::web::ContextFeatureFlags kWebRunnerFeatures =
fuchsia::web::ContextFeatureFlags::NETWORK |
fuchsia::web::ContextFeatureFlags::AUDIO |
fuchsia::web::ContextFeatureFlags::VULKAN |
fuchsia::web::ContextFeatureFlags::HARDWARE_VIDEO_DECODER |
fuchsia::web::ContextFeatureFlags::WIDEVINE_CDM;
// Vulkan is not currently available in our integration test environment.
DisableVulkanIfUnavailable(&features);
WebContentRunner runner(
base::fuchsia::ComponentContextForCurrentProcess()->outgoing().get(),
base::BindOnce(&WebContentRunner::CreateDefaultWebContext, features));
base::BindOnce(&WebContentRunner::CreateDefaultWebContext,
kWebRunnerFeatures));
base::fuchsia::ComponentContextForCurrentProcess()
->outgoing()
......
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