Skip to content

Commit

Permalink
Remove legacy SwiftShader
Browse files Browse the repository at this point in the history
Bug: chromium:1060139
Change-Id: I7e0a186a2a47c1c85bee53f2179f2e5c6b63882d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3380402
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Polina Bondarenko <pbond@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Samuel Huang <huangs@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@google.com>
Cr-Commit-Position: refs/heads/main@{#990043}
  • Loading branch information
sugoi1 authored and Chromium LUCI CQ committed Apr 7, 2022
1 parent 5e29677 commit f383e7b
Show file tree
Hide file tree
Showing 40 changed files with 45 additions and 388 deletions.
4 changes: 3 additions & 1 deletion ash/components/arc/enterprise/arc_data_snapshotd_manager.cc
Expand Up @@ -75,7 +75,9 @@ void EnableHeadlessMode() {
auto* command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitchASCII(switches::kOzonePlatform, kHeadless);
command_line->AppendSwitchASCII(switches::kUseGL,
gl::kGLImplementationSwiftShaderName);
gl::kGLImplementationANGLEName);
command_line->AppendSwitchASCII(switches::kUseANGLE,
gl::kANGLEImplementationSwiftShaderName);
}

// Disables D-Bus clients:
Expand Down
44 changes: 1 addition & 43 deletions chrome/BUILD.gn
Expand Up @@ -974,16 +974,11 @@ if (is_win) {
# Add the SwiftShader .dylibs in the MODULE_DIR of Chromium.app
bundle_data("swiftshader_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [
"//ui/gl:swiftshader_egl_library_copy",
"//ui/gl:swiftshader_vk_library_copy",
]
public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
}
}

Expand Down Expand Up @@ -1269,8 +1264,6 @@ if (is_win) {
"$root_out_dir/chrome_crashpad_handler",
"$root_out_dir/libEGL.dylib",
"$root_out_dir/libGLESv2.dylib",
"$root_out_dir/libswiftshader_libEGL.dylib",
"$root_out_dir/libswiftshader_libGLESv2.dylib",
"$root_out_dir/libvk_swiftshader.dylib",
_framework_binary_path,
]
Expand Down Expand Up @@ -1309,8 +1302,6 @@ if (is_win) {
"//components/crash/core/app:chrome_crashpad_handler",
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
"//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
"//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
dump_syms,
]
Expand All @@ -1336,8 +1327,6 @@ if (is_win) {
"$root_out_dir/chrome_crashpad_handler.dSYM",
"$root_out_dir/libEGL.dylib.dSYM",
"$root_out_dir/libGLESv2.dylib.dSYM",
"$root_out_dir/libswiftshader_libEGL.dylib.dSYM",
"$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM",
"$root_out_dir/libvk_swiftshader.dylib.dSYM",
]
if (build_with_internal_optimization_guide) {
Expand All @@ -1350,8 +1339,6 @@ if (is_win) {
"//components/crash/core/app:chrome_crashpad_handler",
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
"//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
"//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
]
if (build_with_internal_optimization_guide) {
Expand Down Expand Up @@ -1725,8 +1712,6 @@ if (is_linux || is_chromeos) {
":angle_gles_symbols",
":chrome_crashpad_symbols",
":chrome_symbols",
":swiftshader_egl_symbols",
":swiftshader_gles_symbols",
]
if (is_linux) {
deps += [ ":swiftshader_vk_symbols" ]
Expand Down Expand Up @@ -1762,33 +1747,6 @@ if (is_linux || is_chromeos) {

deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
extract_symbols("swiftshader_egl_symbols") {
binary = "$root_out_dir/swiftshader/libEGL.so"

if (current_cpu == "x86") {
# GYP used "ia32" so keep that naming for back-compat.
symbol_file = "$root_out_dir/swiftshader_libegl.breakpad.ia32"
} else {
symbol_file = "$root_out_dir/swiftshader_libegl.breakpad.$current_cpu"
}

deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}
extract_symbols("swiftshader_gles_symbols") {
binary = "$root_out_dir/swiftshader/libGLESv2.so"

if (current_cpu == "x86") {
# GYP used "ia32" so keep that naming for back-compat.
symbol_file = "$root_out_dir/swiftshader_libgles.breakpad.ia32"
} else {
symbol_file = "$root_out_dir/swiftshader_libgles.breakpad.$current_cpu"
}

deps = [
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
}
extract_symbols("swiftshader_vk_symbols") {
binary = "$root_out_dir/libvk_swiftshader.so"

Expand Down
32 changes: 1 addition & 31 deletions chrome/installer/linux/BUILD.gn
Expand Up @@ -80,11 +80,7 @@ if (use_egl) {
}

if (enable_swiftshader) {
packaging_files_shlibs += [
"$root_out_dir/swiftshader_libEGL.so",
"$root_out_dir/swiftshader_libGLESv2.so",
"$root_out_dir/libvk_swiftshader.so",
]
packaging_files_shlibs += [ "$root_out_dir/libvk_swiftshader.so" ]
}

if (build_with_internal_optimization_guide) {
Expand All @@ -94,18 +90,6 @@ if (build_with_internal_optimization_guide) {

packaging_files_binaries = packaging_files_executables + packaging_files_shlibs

copy("swiftshader_libs") {
sources = [
"$root_out_dir/swiftshader/libEGL.so",
"$root_out_dir/swiftshader/libGLESv2.so",
]
outputs = [ "$root_out_dir/swiftshader_{{source_file_part}}" ]
public_deps = [
"//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
}

# TODO(mmoss) Any convenient way to get all the relevant build files?
# (e.g. all locales, resources, etc.)
packaging_files = packaging_files_binaries + [
Expand Down Expand Up @@ -224,17 +208,6 @@ strip_binary("strip_libvulkan_shlib") {
deps = [ "//third_party/vulkan-deps/vulkan-loader/src:libvulkan" ]
}

strip_binary("strip_swiftshader_libEGL_shlib") {
binary_input = "$root_out_dir/swiftshader/libEGL.so"
deps = [ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}

strip_binary("strip_swiftshader_libGLESv2_shlib") {
binary_input = "$root_out_dir/swiftshader/libGLESv2.so"
deps =
[ "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2" ]
}

strip_binary("strip_libvk_swiftshader.shlib") {
binary_input = "$root_out_dir/libvk_swiftshader.so"
deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ]
Expand Down Expand Up @@ -440,9 +413,6 @@ group("installer_deps") {
if (enable_swiftshader) {
public_deps += [
":strip_libvk_swiftshader.shlib",
":strip_swiftshader_libEGL_shlib",
":strip_swiftshader_libGLESv2_shlib",
":swiftshader_libs",
"//third_party/swiftshader/src/Vulkan:icd_file",
"//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
]
Expand Down
9 changes: 0 additions & 9 deletions chrome/installer/linux/common/installer.include
Expand Up @@ -232,15 +232,6 @@ stage_install_common() {
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
fi

# SwiftShader ES
if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
for file in libEGL.so libGLESv2.so; do
strippedfile="${OUTPUTDIR}/swiftshader/${file}.stripped"
install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}"
done
fi

# SwiftShader VK
if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/"
Expand Down
2 changes: 0 additions & 2 deletions chrome/installer/mac/signing/parts.py
Expand Up @@ -120,8 +120,6 @@ def get_parts(config):
dylibs = [
'libEGL.dylib',
'libGLESv2.dylib',
'libswiftshader_libEGL.dylib',
'libswiftshader_libGLESv2.dylib',
'libvk_swiftshader.dylib',
]
if config.is_chrome_branded():
Expand Down
6 changes: 0 additions & 6 deletions chrome/installer/mini_installer/chrome.release
Expand Up @@ -54,12 +54,6 @@ locales\*.pak: %(VersionDir)s\Locales
Logo.png: %(VersionDir)s\VisualElements\
SmallLogo.png: %(VersionDir)s\VisualElements\

#
# SwiftShader sub-dir
#
swiftshader\libEGL.dll: %(VersionDir)s\swiftshader\
swiftshader\libGLESv2.dll: %(VersionDir)s\swiftshader\

#
# MEI Preload sub dir
#
Expand Down
20 changes: 0 additions & 20 deletions chrome/tools/build/win/FILES.cfg
Expand Up @@ -383,16 +383,6 @@ FILES = [
'filegroup': ['default', 'symsrc'],
},
# SwiftShader files:
{
'filename': 'swiftshader/libEGL.dll',
'buildtype': ['official'],
'filegroup': ['default', 'symsrc'],
},
{
'filename': 'swiftshader/libGLESv2.dll',
'buildtype': ['official'],
'filegroup': ['default', 'symsrc'],
},
{
'filename': 'vk_swiftshader.dll',
'buildtype': ['official'],
Expand Down Expand Up @@ -666,16 +656,6 @@ FILES = [
'buildtype': ['official'],
'archive': 'chrome-win32-syms.zip',
},
{
'filename': 'swiftshader/libEGL.dll.pdb',
'buildtype': ['official'],
'archive': 'chrome-win32-syms.zip',
},
{
'filename': 'swiftshader/libGLESv2.dll.pdb',
'buildtype': ['official'],
'archive': 'chrome-win32-syms.zip',
},
{
'filename': 'vk_swiftshader.dll.pdb',
'buildtype': ['official'],
Expand Down
7 changes: 1 addition & 6 deletions content/shell/BUILD.gn
Expand Up @@ -824,16 +824,11 @@ if (is_mac) {
# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
bundle_data("content_shell_swiftshader_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [
"//ui/gl:swiftshader_egl_library_copy",
"//ui/gl:swiftshader_vk_library_copy",
]
public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
}
}

Expand Down
2 changes: 0 additions & 2 deletions fuchsia/engine/BUILD.gn
Expand Up @@ -342,8 +342,6 @@ _web_engine_excluded_files = [
# not be included in the WebEngine package.
# Whenever this list is updated the exclusions in the cast_runner package
# should be updated as well (see fuchsia/runners/BUILD.gn).
"lib/libswiftshader_libEGL.so",
"lib/libswiftshader_libGLESv2.so",
"lib/libvk_swiftshader.so",
"vk_swiftshader_icd.json",
]
Expand Down
2 changes: 0 additions & 2 deletions fuchsia/runners/BUILD.gn
Expand Up @@ -143,8 +143,6 @@ _web_instance_host_deps_files_to_exclude = [
# TODO(crbug.com/1022542): SwiftShader is not used in cast_runner.
# This list should match the list of SwiftShader files excluded from the
# web_engine package (see fuchsia/engine/BUILD.gn).
"lib/libswiftshader_libEGL.so",
"lib/libswiftshader_libGLESv2.so",
"lib/libvk_swiftshader.so",
"vk_swiftshader_icd.json",
]
Expand Down
5 changes: 2 additions & 3 deletions gpu/command_buffer/service/feature_info.cc
Expand Up @@ -222,9 +222,8 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
const auto useANGLE = command_line->GetSwitchValueASCII(switches::kUseANGLE);

feature_flags_.is_swiftshader_for_webgl =
(useGL == gl::kGLImplementationSwiftShaderForWebGLName) ||
((useGL == gl::kGLImplementationANGLEName) &&
(useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName));
(useGL == gl::kGLImplementationANGLEName) &&
(useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName);

// The shader translator is needed to translate from WebGL-conformant GLES SL
// to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to
Expand Down
21 changes: 2 additions & 19 deletions gpu/config/gpu_info_collector.cc
Expand Up @@ -299,16 +299,14 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
&fallback_to_software);

// If GL is disabled then we don't need GPUInfo.
if (implementation && *implementation == gl::kGLImplementationDisabled) {
if (implementation == gl::kGLImplementationDisabled) {
gpu_info->gl_vendor = "Disabled";
gpu_info->gl_renderer = "Disabled";
gpu_info->gl_version = "Disabled";
return true;
}

gl::GLImplementationParts legacy_impl =
gl::GetLegacySoftwareGLImplementation();
if (implementation && *implementation == legacy_impl) {
if (implementation == gl::GetSoftwareGLImplementation()) {
// If using the software GL implementation, use fake vendor and
// device ids to make sure it never gets blocklisted. It allows us
// to proceed with loading the blocklist which may have non-device
Expand All @@ -317,21 +315,6 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
gpu_info->gpu.vendor_id = 0xffff;
gpu_info->gpu.device_id = 0xffff;

// Also declare the driver_vendor to be <software GL> to be able to
// specify exceptions based on driver_vendor==<software GL> for some
// blocklist rules.
gpu_info->gpu.driver_vendor = gl::GetGLImplementationGLName(legacy_impl);

return true;
}

if (implementation &&
*implementation == gl::ANGLEImplementation::kSwiftShader) {
// Similarly to the above, use fake vendor and device ids
// to make sure they never gets blocklisted for SwANGLE as well.
gpu_info->gpu.vendor_id = 0xffff;
gpu_info->gpu.device_id = 0xffff;

// Also declare the driver_vendor to be <SwANGLE> to be able to
// specify exceptions based on driver_vendor==<SwANGLE> for some
// blocklist rules.
Expand Down
3 changes: 1 addition & 2 deletions gpu/config/gpu_util.cc
Expand Up @@ -540,8 +540,7 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info,
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
std::string use_angle =
command_line->GetSwitchValueASCII(switches::kUseANGLE);
if (use_gl == gl::kGLImplementationSwiftShaderForWebGLName ||
use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) {
if (use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) {
return ComputeGpuFeatureInfoForSwiftShader();
}
}
Expand Down
11 changes: 4 additions & 7 deletions gpu/ipc/service/gpu_init.cc
Expand Up @@ -667,18 +667,15 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime",
elapsed_timer.Elapsed());

// Software GL is expected to run slowly, so disable the watchdog
// SwANGLE is expected to run slowly, so disable the watchdog
// in that case.
// In SwiftShader case, the implementation is actually EGLGLES2.
if (!gl_use_swiftshader_ && command_line->HasSwitch(switches::kUseGL)) {
std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL);
std::string use_angle =
command_line->GetSwitchValueASCII(switches::kUseANGLE);
if (use_gl == gl::kGLImplementationSwiftShaderName ||
use_gl == gl::kGLImplementationSwiftShaderForWebGLName ||
(use_gl == gl::kGLImplementationANGLEName &&
(use_angle == gl::kANGLEImplementationSwiftShaderName ||
use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName))) {
if (use_gl == gl::kGLImplementationANGLEName &&
(use_angle == gl::kANGLEImplementationSwiftShaderName ||
use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName)) {
gl_use_swiftshader_ = true;
}
}
Expand Down
1 change: 0 additions & 1 deletion gpu/ipc/service/image_transport_surface_mac.mm
Expand Up @@ -29,7 +29,6 @@
#if defined(USE_EGL)
case gl::kGLImplementationEGLGLES2:
case gl::kGLImplementationEGLANGLE:
case gl::kGLImplementationSwiftShaderGL:
return base::WrapRefCounted<gl::GLSurface>(
new ImageTransportSurfaceOverlayMacEGL(delegate));
#endif
Expand Down
11 changes: 3 additions & 8 deletions headless/public/headless_browser.cc
Expand Up @@ -36,17 +36,12 @@ std::string GetProductNameAndVersion() {
Options::Options(int argc, const char** argv)
: argc(argc),
argv(argv),
gl_implementation(gl::kGLImplementationSwiftShaderForWebGLName),
angle_implementation(gl::kANGLEImplementationNoneName),
gl_implementation(gl::kGLImplementationANGLEName),
angle_implementation(gl::kANGLEImplementationSwiftShaderForWebGLName),
product_name_and_version(GetProductNameAndVersion()),
user_agent(content::BuildUserAgentFromProduct(product_name_and_version)),
window_size(kDefaultWindowSize),
font_render_hinting(kDefaultFontRenderHinting) {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
gl_implementation = gl::kGLImplementationANGLEName;
angle_implementation = gl::kANGLEImplementationSwiftShaderForWebGLName;
#endif
}
font_render_hinting(kDefaultFontRenderHinting) {}

Options::Options(Options&& options) = default;

Expand Down

0 comments on commit f383e7b

Please sign in to comment.