Skip to content

Commit

Permalink
Reland "Replace GPU Compositing feature with GL"
Browse files Browse the repository at this point in the history
This reverts commit baefa2e.

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 8834f5a.
>
> 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/+/1940884
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Sean Gilhuly <sgilhuly@chromium.org>
Reviewed-by: Zhenyao 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}
  • Loading branch information
Sean Gilhuly authored and Commit Bot committed Nov 28, 2019
1 parent 6f71775 commit 1e54ddb
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 53 deletions.
4 changes: 2 additions & 2 deletions content/browser/compositor/gpu_process_transport_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(

if (gpu_channel_host &&
gpu_channel_host->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] !=
.status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_GL] !=
gpu::kGpuFeatureStatusEnabled) {
use_gpu_compositing = false;
}
Expand Down Expand Up @@ -785,7 +785,7 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
gpu_channel_factory_->EstablishGpuChannelSync();
if (!gpu_channel_host ||
gpu_channel_host->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] !=
.status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_GL] !=
gpu::kGpuFeatureStatusEnabled) {
DisableGpuCompositing(nullptr);
if (gpu_channel_host)
Expand Down
4 changes: 3 additions & 1 deletion content/browser/compositor/viz_process_transport_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,10 @@ VizProcessTransportFactory::TryCreateContextsForGpuCompositing(

const auto& gpu_feature_info = gpu_channel_host->gpu_feature_info();
// 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 =
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)
return gpu::ContextResult::kFatalFailure;

Expand Down
27 changes: 16 additions & 11 deletions content/browser/gpu/compositor_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ gpu::GpuFeatureStatus SafeGetFeatureStatus(
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 gpu::GpuFeatureInfo& gpu_feature_info,
size_t index,
Expand All @@ -111,8 +105,14 @@ const GpuFeatureData GetGpuFeatureData(
"Accelerated 2D canvas is unavailable: either disabled "
"via blacklist or the command line."),
true},
{"gpu_compositing", GetGpuCompositingStatus(gpu_feature_info),
command_line.HasSwitch(switches::kDisableGpuCompositing),
{"gpu_compositing",
// 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(
"Gpu compositing has been disabled, either via blacklist, about:flags "
"or the command line. The browser will fall back to software "
Expand Down Expand Up @@ -176,6 +176,11 @@ const GpuFeatureData GetGpuFeatureData(
gpu::GPU_FEATURE_TYPE_OOP_RASTERIZATION),
command_line.HasSwitch(switches::kDisableOopRasterization),
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)
{"metal",
SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_METAL),
Expand Down Expand Up @@ -261,8 +266,7 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl(
status = "enabled";
if ((gpu_feature_data.name == "webgl" ||
gpu_feature_data.name == "webgl2") &&
(GetGpuCompositingStatus(gpu_feature_info) !=
gpu::kGpuFeatureStatusEnabled))
manager->IsGpuCompositingDisabled())
status += "_readback";
if (gpu_feature_data.name == "rasterization") {
if (IsForceGpuRasterizationEnabled())
Expand All @@ -275,7 +279,8 @@ std::unique_ptr<base::DictionaryValue> GetFeatureStatusImpl(
status += "_force";
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 == "surface_control") {
status += "_on";
Expand Down
18 changes: 5 additions & 13 deletions content/browser/gpu/gpu_data_manager_impl_private.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void UpdateFeatureStats(const gpu::GpuFeatureInfo& gpu_feature_info) {
*base::CommandLine::ForCurrentProcess();
const gpu::GpuFeatureType kGpuFeatures[] = {
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_OOP_RASTERIZATION,
gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
Expand Down Expand Up @@ -615,10 +615,6 @@ void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo(
const base::Optional<gpu::GpuFeatureInfo>&
gpu_feature_info_for_hardware_gpu) {
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.has_value()) {
DCHECK(gpu_feature_info_for_hardware_gpu->IsInitialized());
Expand Down Expand Up @@ -658,14 +654,10 @@ bool GpuDataManagerImplPrivate::IsGpuCompositingDisabled() const {
}

void GpuDataManagerImplPrivate::SetGpuCompositingDisabled() {
disable_gpu_compositing_ = true;

if (gpu_feature_info_.IsInitialized() &&
gpu_feature_info_.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] ==
gpu::kGpuFeatureStatusEnabled) {
gpu_feature_info_.status_values[gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING] =
gpu::kGpuFeatureStatusDisabled;
NotifyGpuInfoUpdate();
if (!IsGpuCompositingDisabled()) {
disable_gpu_compositing_ = true;
if (gpu_feature_info_.IsInitialized())
NotifyGpuInfoUpdate();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ const GpuControlList::More kMoreForEntry5_572251052Exception0 = {

const int kFeatureListForGpuManagerTestingEntry6[14] = {
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_FLASH3D,
GPU_FEATURE_TYPE_METAL,
Expand All @@ -170,7 +171,6 @@ const int kFeatureListForGpuManagerTestingEntry6[14] = {
GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE,
GPU_FEATURE_TYPE_OOP_RASTERIZATION,
GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE,
GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL,
GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
GPU_FEATURE_TYPE_VULKAN,
GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE,
Expand Down
1 change: 1 addition & 0 deletions content/browser/resources/gpu/info_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ cr.define('gpu', function() {
'video_decode': 'Video Decode',
'rasterization': 'Rasterization',
'oop_rasterization': 'Out-of-process Rasterization',
'opengl': 'OpenGL',
'metal': 'Metal',
'vulkan': 'Vulkan',
'multiple_raster_threads': 'Multiple Raster Threads',
Expand Down
2 changes: 1 addition & 1 deletion content/test/gpu/gpu_tests/gpu_process_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _GpuProcess_driver_bug_workarounds_in_gpu_process(self, test_path):
def _GpuProcess_readback_webgl_gpu_process(self, test_path):
# Hit test group 1 with entry 152 from kSoftwareRenderingListEntries.
self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([
'--gpu-blacklist-test-group=1']))
'--gpu-blacklist-test-group=1', '--disable-gpu-compositing']))
self._Navigate(test_path)
feature_status_list = self.tab.EvaluateJavaScript(
'browserBridge.gpuInfo.featureStatus.featureStatus')
Expand Down
3 changes: 1 addition & 2 deletions gpu/config/gpu_blocklist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create(
std::unique_ptr<GpuBlocklist> list(new GpuBlocklist(data));
list->AddSupportedFeature("accelerated_2d_canvas",
GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS);
list->AddSupportedFeature("gpu_compositing",
GPU_FEATURE_TYPE_GPU_COMPOSITING);
list->AddSupportedFeature("accelerated_webgl",
GPU_FEATURE_TYPE_ACCELERATED_WEBGL);
list->AddSupportedFeature("flash3d", GPU_FEATURE_TYPE_FLASH3D);
Expand All @@ -47,6 +45,7 @@ std::unique_ptr<GpuBlocklist> GpuBlocklist::Create(
GPU_FEATURE_TYPE_OOP_RASTERIZATION);
list->AddSupportedFeature("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("vulkan", GPU_FEATURE_TYPE_VULKAN);
return list;
Expand Down
6 changes: 4 additions & 2 deletions gpu/config/gpu_blocklist_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ class GpuBlocklistTest : public testing::Test {
GPU_BLOCKLIST_FEATURE_TEST(Accelerated2DCanvas,
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(Flash3D, GPU_FEATURE_TYPE_FLASH3D)
Expand All @@ -106,6 +104,10 @@ GPU_BLOCKLIST_FEATURE_TEST(WebGL2, GPU_FEATURE_TYPE_ACCELERATED_WEBGL2)
GPU_BLOCKLIST_FEATURE_TEST(ProtectedVideoDecode,
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".
// See GpuControlList::GpuControlList.
// It checks software_rendering_list.json
Expand Down
2 changes: 1 addition & 1 deletion gpu/config/gpu_feature_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool GpuFeatureInfo::IsWorkaroundEnabled(int32_t workaround) const {

bool GpuFeatureInfo::IsInitialized() const {
// Check if any feature status is undefined.
return status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] !=
return status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] !=
kGpuFeatureStatusUndefined;
}

Expand Down
2 changes: 1 addition & 1 deletion gpu/config/gpu_feature_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace gpu {
// If a bit is set to 1, corresponding feature is blacklisted.
enum GpuFeatureType {
GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS = 0,
GPU_FEATURE_TYPE_GPU_COMPOSITING,
GPU_FEATURE_TYPE_ACCELERATED_WEBGL,
GPU_FEATURE_TYPE_FLASH3D,
GPU_FEATURE_TYPE_FLASH_STAGE3D,
Expand All @@ -23,6 +22,7 @@ enum GpuFeatureType {
GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE,
GPU_FEATURE_TYPE_OOP_RASTERIZATION,
GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL,
GPU_FEATURE_TYPE_ACCELERATED_GL,
GPU_FEATURE_TYPE_METAL,
GPU_FEATURE_TYPE_VULKAN,
NUMBER_OF_GPU_FEATURE_TYPES
Expand Down
30 changes: 15 additions & 15 deletions gpu/config/gpu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,14 @@ GpuFeatureStatus GetAcceleratedVideoDecodeFeatureStatus(
return kGpuFeatureStatusEnabled;
}

GpuFeatureStatus GetGpuCompositingFeatureStatus(
const std::set<int>& blacklisted_features,
bool use_swift_shader) {
GpuFeatureStatus GetGLFeatureStatus(const std::set<int>& blacklisted_features,
bool use_swift_shader) {
if (use_swift_shader) {
// This is for testing only. Chrome should exercise the GPU accelerated
// path on top of SwiftShader driver.
return kGpuFeatureStatusEnabled;
}
if (blacklisted_features.count(GPU_FEATURE_TYPE_GPU_COMPOSITING))
if (blacklisted_features.count(GPU_FEATURE_TYPE_ACCELERATED_GL))
return kGpuFeatureStatusBlacklisted;
return kGpuFeatureStatusEnabled;
}
Expand Down Expand Up @@ -308,8 +307,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
Expand All @@ -330,6 +327,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithHardwareAccelerationDisabled() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
Expand All @@ -346,8 +345,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
Expand All @@ -368,6 +365,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoWithNoGpu() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
Expand All @@ -384,8 +383,6 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
GpuFeatureInfo gpu_feature_info;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_COMPOSITING] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] =
kGpuFeatureStatusSoftware;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_FLASH3D] =
Expand All @@ -406,6 +403,8 @@ GpuFeatureInfo ComputeGpuFeatureInfoForSwiftShader() {
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_METAL] =
kGpuFeatureStatusDisabled;
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
Expand Down Expand Up @@ -478,8 +477,6 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] =
GetAcceleratedVideoDecodeFeatureStatus(blacklisted_features,
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] =
GetProtectedVideoDecodeFeatureStatus(blacklisted_features, gpu_info,
use_swift_shader);
Expand All @@ -489,6 +486,8 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
GetAndroidSurfaceControlFeatureStatus(blacklisted_features,
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] =
GetMetalFeatureStatus(blacklisted_features, gpu_preferences);
gpu_feature_info.status_values[GPU_FEATURE_TYPE_VULKAN] =
Expand Down Expand Up @@ -663,13 +662,14 @@ bool EnableSwiftShaderIfNeeded(base::CommandLine* command_line,
bool disable_software_rasterizer,
bool blacklist_needs_more_info) {
#if BUILDFLAG(ENABLE_SWIFTSHADER)
if (disable_software_rasterizer)
if (disable_software_rasterizer || blacklist_needs_more_info)
return false;
// Don't overwrite user preference.
if (command_line->HasSwitch(switches::kUseGL))
return false;
if (!blacklist_needs_more_info &&
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] !=
if (gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL] !=
kGpuFeatureStatusEnabled ||
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ACCELERATED_GL] !=
kGpuFeatureStatusEnabled) {
command_line->AppendSwitchASCII(
switches::kUseGL, gl::kGLImplementationSwiftShaderForWebGLName);
Expand Down
1 change: 1 addition & 0 deletions gpu/config/software_rendering_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,7 @@
"features": [
"all",
{"exceptions": [
"accelerated_gl",
"accelerated_webgl"
]}
]
Expand Down
4 changes: 2 additions & 2 deletions gpu/ipc/service/gpu_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
} else { // use_swiftshader == true
switch (gpu_preferences_.use_vulkan) {
case gpu::VulkanImplementationName::kNative: {
// Collect GPU info, so we can use backlist to disable vulkan if it is
// needed.
// Collect GPU info, so we can use blacklist to disable vulkan if it
// is needed.
gpu::GPUInfo gpu_info;
if (!CollectGraphicsInfo(&gpu_info, gpu_preferences_))
return false;
Expand Down

0 comments on commit 1e54ddb

Please sign in to comment.