Roll SwiftShader, ANGLE, use SwANGLE in test harnesses (flutter/engine#33814)
Roll Swiftshader, ANGLE, and Vulkan deps. Updates license bot for new locations of licenses and new files in roll. Converts unit test harnesses to use SwANGLE, which is the supported way of using SwiftShader as a software backend for GLES. Updates goldens due to swiftshader changes. Fixes up include paths to avoid directly including third_party code by that name, which is unlikely to work in other build environments. Includes upstream patches to ANGLE and SwiftShader to build in our windows environments, as well as patches to Skia to support defining the location of VulkanMemoryAllocator and a patch to ANGLE to support opting into a newer version of VMA.
41
DEPS
@@ -111,7 +111,7 @@ allowed_hosts = [
|
||||
]
|
||||
|
||||
deps = {
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + '09b25535a092e89d817a2808e7745c8d111c0be5',
|
||||
'src': 'https://github.com/flutter/buildroot.git' + '@' + '87d5dcb98983da54257f6f39d3beee2989cb0e47',
|
||||
|
||||
# Fuchsia compatibility
|
||||
#
|
||||
@@ -137,26 +137,12 @@ deps = {
|
||||
'src/third_party/shaderc':
|
||||
Var('github_git') + '/google/shaderc.git' + '@' + '948660cccfbbc303d2590c7f44a4cee40b66fdd6',
|
||||
|
||||
'src/third_party/glslang':
|
||||
Var('github_git') + '/KhronosGroup/glslang.git' + '@' + '9431c53c84c14fa9e9cd37678262ebba55c62c87',
|
||||
|
||||
'src/third_party/spirv_tools':
|
||||
Var('github_git') + '/KhronosGroup/SPIRV-Tools.git' + '@' + '1020e394cb1267332d58497150d2b024371a8e41',
|
||||
|
||||
'src/third_party/spirv_headers':
|
||||
Var('github_git') + '/KhronosGroup/SPIRV-Headers.git' + '@' + '85b7e00c7d785962ffe851a177c84353d037dcb6',
|
||||
|
||||
'src/third_party/spirv_cross':
|
||||
Var('github_git') + '/KhronosGroup/SPIRV-Cross.git' + '@' + '418542eaefdb609f548d25a1e3962fb69d80da63',
|
||||
'src/third_party/vulkan-deps':
|
||||
Var('chromium_git') + '/vulkan-deps' + '@' + '23b710f1a0b3c44d51035c6400a554415f95d9c6',
|
||||
|
||||
'src/third_party/flatbuffers':
|
||||
Var('github_git') + '/google/flatbuffers.git' + '@' + '967df08b1dbddc62f867464c2e0d58d8027438ad',
|
||||
|
||||
# Chromium-style
|
||||
#
|
||||
# As part of integrating with Fuchsia, we should eventually remove all these
|
||||
# Chromium-style dependencies.
|
||||
|
||||
'src/third_party/icu':
|
||||
Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '12de966fcbe1d1a48dba310aee63807856ffeee8',
|
||||
|
||||
@@ -472,26 +458,19 @@ deps = {
|
||||
'src/third_party/pyyaml':
|
||||
Var('fuchsia_git') + '/third_party/pyyaml.git' + '@' + '25e97546488eee166b1abb229a27856cecd8b7ac',
|
||||
|
||||
# Upstream Khronos Vulkan Headers (v1.1.130)
|
||||
'src/third_party/vulkan-headers':
|
||||
Var('github_git') + '/KhronosGroup/Vulkan-Headers.git' + '@' + '0e57fc1cfa56a203efe43e4dfb9b3c9e9b105593',
|
||||
|
||||
# Skia VMA dependency.
|
||||
'src/third_party/externals/vulkanmemoryallocator':
|
||||
Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '7de5cc00de50e71a3aab22dea52fbb7ff4efceb6',
|
||||
|
||||
# Upstream Khronos Vulkan Headers are part of vulkan-deps
|
||||
# Downstream Fuchsia Vulkan Headers (v1.2.198)
|
||||
'src/third_party/fuchsia-vulkan':
|
||||
Var('fuchsia_git') + '/third_party/Vulkan-Headers.git' + '@' + '32640ad82ef648768c706c9bf828b77123a09bc2',
|
||||
|
||||
'src/third_party/swiftshader':
|
||||
Var('swiftshader_git') + '/SwiftShader.git' + '@' + 'd4130e9ac3675dadbec8442dc2310a80ea4ddfb2',
|
||||
Var('swiftshader_git') + '/SwiftShader.git' + '@' + 'bea8d2471bd912220ba59032e0738f3364632657',
|
||||
|
||||
'src/third_party/angle':
|
||||
Var('github_git') + '/google/angle.git' + '@' + 'acdec48addfdff315efff293be0d5e2e37e8e560',
|
||||
Var('chromium_git') + '/angle/angle.git' + '@' + '3faaded8234b31dea24c929e40e33089a34a9aa5',
|
||||
|
||||
'src/third_party/angle/third_party/vulkan-deps/vulkan-headers/src':
|
||||
Var('fuchsia_git') + '/third_party/Vulkan-Headers.git' + '@' + '5de4e8fab88ef0bd6994d9ddbcc864e3179b9e79',
|
||||
'src/third_party/vulkan_memory_allocator':
|
||||
Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator' + '@' + '7de5cc00de50e71a3aab22dea52fbb7ff4efceb6',
|
||||
|
||||
'src/third_party/abseil-cpp':
|
||||
Var('chromium_git') + '/chromium/src/third_party/abseil-cpp.git' + '@' + '2d8c1340f0350828f1287c4eaeebefcf317bcfc9',
|
||||
@@ -687,6 +666,10 @@ deps = {
|
||||
},
|
||||
}
|
||||
|
||||
recursedeps = [
|
||||
'src/third_party/vulkan-deps',
|
||||
]
|
||||
|
||||
hooks = [
|
||||
{
|
||||
# Generate the Dart SDK's .dart_tool/package_confg.json file.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Signature: 62f85bbfe0c4ce501a865747f7bb099e
|
||||
Signature: 0be7d6e5107b5c14bae7579aafdcbb7e
|
||||
|
||||
|
||||
@@ -12,5 +12,6 @@ executable("vulkan_glfw") {
|
||||
deps = [
|
||||
"//flutter/shell/platform/embedder:embedder",
|
||||
"//third_party/glfw",
|
||||
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import("//flutter/impeller/tools/impeller.gni")
|
||||
import("//flutter/shell/version/version.gni")
|
||||
|
||||
impeller_component("compiler_lib") {
|
||||
include_dirs = [ "//third_party/vulkan-deps/spirv-cross/src/" ]
|
||||
|
||||
sources = [
|
||||
"code_gen_template.h",
|
||||
"compiler.cc",
|
||||
@@ -77,7 +79,7 @@ generated_file("impellerc_license") {
|
||||
"",
|
||||
"### spirv_cross",
|
||||
"",
|
||||
read_file("//third_party/spirv_cross/LICENSE", "string"),
|
||||
read_file("//third_party/vulkan-deps/spirv-cross/src/LICENSE", "string"),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#include "impeller/compiler/source_options.h"
|
||||
#include "impeller/compiler/types.h"
|
||||
#include "shaderc/shaderc.hpp"
|
||||
#include "third_party/spirv_cross/spirv_msl.hpp"
|
||||
#include "third_party/spirv_cross/spirv_parser.hpp"
|
||||
#include "spirv_msl.hpp"
|
||||
#include "spirv_parser.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include "flutter/fml/logging.h"
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "third_party/spirv_cross/spirv_glsl.hpp"
|
||||
#include "third_party/spirv_cross/spirv_msl.hpp"
|
||||
#include "spirv_glsl.hpp"
|
||||
#include "spirv_msl.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "impeller/compiler/compiler_backend.h"
|
||||
#include "impeller/compiler/runtime_stage_data.h"
|
||||
#include "inja/inja.hpp"
|
||||
#include "third_party/spirv_cross/spirv_msl.hpp"
|
||||
#include "third_party/spirv_cross/spirv_parser.hpp"
|
||||
#include "spirv_msl.hpp"
|
||||
#include "spirv_parser.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "flutter/fml/mapping.h"
|
||||
#include "impeller/compiler/types.h"
|
||||
#include "third_party/spirv_cross/spirv_parser.hpp"
|
||||
#include "spirv_parser.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "shaderc/shaderc.hpp"
|
||||
#include "third_party/spirv_cross/spirv_cross.hpp"
|
||||
#include "third_party/spirv_cross/spirv_msl.hpp"
|
||||
#include "spirv_cross.hpp"
|
||||
#include "spirv_msl.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -57,7 +57,7 @@ impeller_component("gles") {
|
||||
"texture_gles.h",
|
||||
]
|
||||
|
||||
if (!is_android) {
|
||||
if (!is_android && !is_fuchsia) {
|
||||
public_configs = [ ":gles_config" ]
|
||||
sources += [
|
||||
"//third_party/angle/include/GLES2/gl2.h",
|
||||
|
||||
@@ -6,13 +6,16 @@ import("//flutter/testing/testing.gni")
|
||||
|
||||
if (enable_unittests) {
|
||||
executable("spirv_assembler") {
|
||||
include_dirs = [ "//third_party/vulkan-deps/spirv-tools/src/include/" ]
|
||||
|
||||
sources = [ "spirv_assembler.cc" ]
|
||||
|
||||
configs += [ "//third_party/swiftshader_flutter:spvtools_public_config" ]
|
||||
configs +=
|
||||
[ "//third_party/vulkan-deps/spirv-tools/src:spvtools_public_config" ]
|
||||
|
||||
deps = [
|
||||
"//third_party/swiftshader_flutter:spvtools",
|
||||
"//third_party/swiftshader_flutter:spvtools_val",
|
||||
"//third_party/vulkan-deps/spirv-tools/src:spvtools",
|
||||
"//third_party/vulkan-deps/spirv-tools/src:spvtools_val",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/swiftshader/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp"
|
||||
#include "spirv-tools/libspirv.hpp"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
||||
@@ -302,9 +302,9 @@ if (enable_unittests) {
|
||||
# TODO(63837): This test is hard-coded to use a TestGLSurface so it cannot run on fuchsia.
|
||||
sources += [ "shell_io_manager_unittests.cc" ]
|
||||
|
||||
# Swiftshader only supports x86/64. Only needed on non-Fuchsia platforms.
|
||||
if (shell_enable_vulkan && (target_cpu == "x86" || target_cpu == "x64")) {
|
||||
deps += [ "//third_party/swiftshader_flutter:swiftshader_vulkan" ]
|
||||
# Swiftshader only needed on non-Fuchsia platforms.
|
||||
if (shell_enable_vulkan) {
|
||||
deps += [ "//third_party/swiftshader" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "fml/trace_event.h"
|
||||
#include "include/core/SkColorSpace.h"
|
||||
#include "include/core/SkSize.h"
|
||||
#include "third_party/swiftshader/include/vulkan/vulkan_core.h"
|
||||
#include "vulkan/vulkan_core.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
|
||||
@@ -244,7 +244,10 @@ if (enable_unittests) {
|
||||
"tests/embedder_unittests_gl.cc",
|
||||
]
|
||||
|
||||
deps += [ "//flutter/testing:opengl" ]
|
||||
deps += [
|
||||
"//flutter/testing:opengl",
|
||||
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
|
||||
]
|
||||
}
|
||||
|
||||
if (test_enable_metal) {
|
||||
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
@@ -8,7 +8,7 @@
|
||||
#include "flutter/shell/platform/embedder/embedder.h"
|
||||
#include "tests/embedder_test_context.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "third_party/swiftshader/include/vulkan/vulkan_core.h"
|
||||
#include "vulkan/vulkan_core.h"
|
||||
|
||||
#ifdef SHELL_ENABLE_GL
|
||||
#include "flutter/shell/platform/embedder/tests/embedder_test_compositor_gl.h"
|
||||
|
||||
@@ -146,10 +146,9 @@ if (enable_unittests) {
|
||||
"//flutter/vulkan",
|
||||
]
|
||||
|
||||
# SwiftShader only supports x86/x86_64
|
||||
if (target_cpu == "x86" || target_cpu == "x64") {
|
||||
configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ]
|
||||
deps += [ "//third_party/swiftshader_flutter:swiftshader_vulkan" ]
|
||||
if (!is_fuchsia) {
|
||||
deps += [ "//third_party/swiftshader" ]
|
||||
configs += [ "//third_party/swiftshader:swiftshader_config" ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,10 +214,8 @@ if (is_mac || is_ios) {
|
||||
}
|
||||
}
|
||||
|
||||
# We only use SwiftShader on unittests and
|
||||
# SwiftShader only supports x86/x86_64
|
||||
use_swiftshader =
|
||||
enable_unittests && (target_cpu == "x86" || target_cpu == "x64")
|
||||
# We only use SwiftShader on unittests
|
||||
use_swiftshader = enable_unittests && !is_fuchsia
|
||||
|
||||
source_set("opengl") {
|
||||
testonly = true
|
||||
@@ -234,7 +231,16 @@ source_set("opengl") {
|
||||
]
|
||||
|
||||
if (use_swiftshader) {
|
||||
configs += [ "//third_party/swiftshader_flutter:swiftshader_config" ]
|
||||
deps += [ "//third_party/swiftshader_flutter:swiftshader_gl" ]
|
||||
configs -= [ "//build/config/clang:extra_warnings" ]
|
||||
configs += [
|
||||
"//flutter/vulkan:vulkan_config", # for swiftshader
|
||||
"//third_party/angle:gl_prototypes",
|
||||
"//third_party/swiftshader:swiftshader_config",
|
||||
]
|
||||
deps += [
|
||||
"//third_party/angle:libEGL_static",
|
||||
"//third_party/angle:libGLESv2_static",
|
||||
"//third_party/swiftshader",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,3 +63,8 @@ leak:fl_message_codec_decode_message
|
||||
# At the time of writing, this only amounts to 4 allocations totaling 512 bytes
|
||||
# worth of leaks.
|
||||
leak:g_realloc
|
||||
|
||||
|
||||
# ANGLE's egl impelementation uses annotations that our LSAN setup does
|
||||
# not respect. Ignore leaks from egl::*
|
||||
leak:egl::*
|
||||
|
||||
@@ -10,6 +10,7 @@ A top level harness to run all unit-tests in a specific engine build.
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import errno
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
@@ -182,10 +183,20 @@ def RunEngineExecutable(
|
||||
|
||||
unstripped_exe = os.path.join(build_dir, 'exe.unstripped', executable_name)
|
||||
env = os.environ.copy()
|
||||
# We cannot run the unstripped binaries directly when coverage is enabled.
|
||||
if IsLinux() and os.path.exists(unstripped_exe) and not coverage:
|
||||
# Some tests depend on the EGL/GLES libraries placed in the build directory.
|
||||
env['LD_LIBRARY_PATH'] = os.path.join(build_dir, 'lib.unstripped')
|
||||
if IsLinux():
|
||||
env['LD_LIBRARY_PATH'] = build_dir
|
||||
env['VK_DRIVER_FILES'] = os.path.join(build_dir, 'vk_swiftshader_icd.json')
|
||||
if os.path.exists(unstripped_exe):
|
||||
try:
|
||||
os.symlink(
|
||||
os.path.join(build_dir, 'lib.unstripped', 'libvulkan.so.1'),
|
||||
os.path.join(build_dir, 'exe.unstripped', 'libvulkan.so.1')
|
||||
)
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
elif IsMac():
|
||||
env['DYLD_LIBRARY_PATH'] = build_dir
|
||||
else:
|
||||
@@ -879,7 +890,7 @@ def RunEngineTasksInParallel(tasks):
|
||||
if len(failures) > 0:
|
||||
print("The following commands failed:")
|
||||
for task, exn in failures:
|
||||
print("%s\n" % str(task))
|
||||
print("%s\n%s\n" % (str(task), str(exn)))
|
||||
raise Exception()
|
||||
|
||||
|
||||
@@ -1000,7 +1011,7 @@ def main():
|
||||
]
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
for line in process.stdout:
|
||||
key, _, value = line.decode('ascii').strip().partition("=")
|
||||
key, _, value = line.decode('utf8').strip().partition("=")
|
||||
os.environ[key] = value
|
||||
process.communicate() # Avoid pipe deadlock while waiting for termination.
|
||||
|
||||
|
||||
@@ -22,5 +22,5 @@ UBSAN_SUPPRESSIONS_FILE="${TESTING_DIRECTORY}/ubsan_suppressions.txt"
|
||||
export UBSAN_OPTIONS="suppressions=${UBSAN_SUPPRESSIONS_FILE}"
|
||||
echo "Using Undefined Behavior suppressions in ${UBSAN_SUPPRESSIONS_FILE}"
|
||||
|
||||
export ASAN_OPTIONS="symbolize=1:detect_leaks=1"
|
||||
export ASAN_OPTIONS="symbolize=1:detect_leaks=1:intercept_tls_get_addr=0"
|
||||
export ASAN_SYMBOLIZER_PATH="${BUILDTOOLS_DIRECTORY}/clang/bin/llvm-symbolizer"
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "flutter/testing/test_gl_surface.h"
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
#include <GLES2/gl2.h>
|
||||
|
||||
#include <sstream>
|
||||
@@ -81,12 +83,54 @@ static std::string GetEGLError() {
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
static bool HasExtension(const char* extensions, const char* name) {
|
||||
const char* r = strstr(extensions, name);
|
||||
auto len = strlen(name);
|
||||
// check that the extension name is terminated by space or null terminator
|
||||
return r != nullptr && (r[len] == ' ' || r[len] == 0);
|
||||
}
|
||||
|
||||
static void CheckSwanglekExtensions() {
|
||||
const char* extensions = ::eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||
FML_CHECK(HasExtension(extensions, "EGL_EXT_platform_base")) << extensions;
|
||||
FML_CHECK(HasExtension(extensions, "EGL_ANGLE_platform_angle_vulkan"))
|
||||
<< extensions;
|
||||
FML_CHECK(HasExtension(extensions,
|
||||
"EGL_ANGLE_platform_angle_device_type_swiftshader"))
|
||||
<< extensions;
|
||||
}
|
||||
|
||||
static EGLDisplay CreateSwangleDisplay() {
|
||||
CheckSwanglekExtensions();
|
||||
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC egl_get_platform_display_EXT =
|
||||
reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
|
||||
eglGetProcAddress("eglGetPlatformDisplayEXT"));
|
||||
FML_CHECK(egl_get_platform_display_EXT)
|
||||
<< "eglGetPlatformDisplayEXT not available.";
|
||||
|
||||
const EGLint display_config[] = {
|
||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE,
|
||||
EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE,
|
||||
EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
return egl_get_platform_display_EXT(
|
||||
EGL_PLATFORM_ANGLE_ANGLE,
|
||||
reinterpret_cast<EGLNativeDisplayType*>(EGL_DEFAULT_DISPLAY),
|
||||
display_config);
|
||||
}
|
||||
|
||||
TestGLSurface::TestGLSurface(SkISize surface_size)
|
||||
: surface_size_(surface_size) {
|
||||
display_ = ::eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
display_ = CreateSwangleDisplay();
|
||||
FML_CHECK(display_ != EGL_NO_DISPLAY);
|
||||
|
||||
auto result = ::eglInitialize(display_, NULL, NULL);
|
||||
auto result = ::eglInitialize(display_, nullptr, nullptr);
|
||||
FML_CHECK(result == EGL_TRUE) << GetEGLError();
|
||||
|
||||
EGLConfig config = {0};
|
||||
|
||||
@@ -426,19 +426,14 @@ def to_gn_args(args):
|
||||
# features can't work on these platforms.
|
||||
if args.target_os not in ['android', 'ios', 'wasm']:
|
||||
gn_args['skia_use_vulkan'] = True
|
||||
gn_args['skia_vulkan_memory_allocator_dir'
|
||||
] = '//third_party/vulkan_memory_allocator'
|
||||
gn_args['shell_enable_vulkan'] = True
|
||||
# Disable VMA's use of std::shared_mutex in environments where the
|
||||
# standard library doesn't support it.
|
||||
if args.target_os == 'ios' or sys.platform.startswith(('cygwin', 'win')):
|
||||
gn_args['skia_disable_vma_stl_shared_mutex'] = True
|
||||
|
||||
if sys.platform.startswith(('cygwin', 'win')):
|
||||
# The buildroot currently isn't set up to support Vulkan in the
|
||||
# Windows ANGLE build, so disable it regardless of enable_vulkan's value.
|
||||
gn_args['angle_enable_vulkan'] = False
|
||||
# Don't build unnecessary portions of the ANGLE tree.
|
||||
gn_args['angle_build_all'] = False
|
||||
|
||||
# We should not need a special case for x86, but this seems to introduce text relocations
|
||||
# even with -fPIC everywhere.
|
||||
# gn_args['enable_profiling'] = args.runtime_mode != 'release' and args.android_cpu != 'x86'
|
||||
@@ -535,6 +530,18 @@ def to_gn_args(args):
|
||||
if args.prebuilt_impellerc is not None:
|
||||
gn_args['impeller_use_prebuilt_impellerc'] = args.prebuilt_impellerc
|
||||
|
||||
# Do not build unnecessary parts of the ANGLE tree.
|
||||
gn_args['angle_build_all'] = False
|
||||
# Requires RTTI. We may want to build this in debug modes, punting on that
|
||||
# for now.
|
||||
gn_args['angle_enable_vulkan_validation_layers'] = False
|
||||
gn_args['angle_vulkan_headers_dir'
|
||||
] = '//third_party/vulkan-deps/vulkan-headers/src'
|
||||
gn_args['angle_vulkan_loader_dir'
|
||||
] = '//third_party/vulkan-deps/vulkan-loader/src'
|
||||
gn_args['angle_vulkan_tools_dir'
|
||||
] = '//third_party/vulkan-deps/vulkan-tools/src'
|
||||
|
||||
return gn_args
|
||||
|
||||
|
||||
|
||||
@@ -1887,6 +1887,47 @@ class _RepositoryWuffsDirectory extends _RepositoryDirectory {
|
||||
}
|
||||
}
|
||||
|
||||
class _RepositoryVulkanDepsDirectory extends _RepositoryDirectory {
|
||||
_RepositoryVulkanDepsDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
|
||||
|
||||
@override
|
||||
bool shouldRecurse(fs.IoNode entry) {
|
||||
return entry.name != '.git' // source control
|
||||
&& entry.name != 'glslang' // only used on hosts for tests
|
||||
&& entry.name != 'spirv-cross' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license
|
||||
&& entry.name != 'spirv-headers' // only used on hosts for tests
|
||||
&& entry.name != 'spirv-tools' // only used on hosts for tests
|
||||
&& entry.name != 'vulkan-loader' // on hosts for tests
|
||||
&& entry.name != 'vulkan-tools' // on hosts for tests
|
||||
&& entry.name != 'vulkan-validation-layers'; // on hosts for tests
|
||||
}
|
||||
|
||||
@override
|
||||
_RepositoryDirectory createSubdirectory(fs.Directory entry) {
|
||||
if (entry.name == 'vulkan-headers') {
|
||||
return _RepositoryVulkanDepsSubDirectory(this, entry);
|
||||
}
|
||||
return super.createSubdirectory(entry);
|
||||
}
|
||||
}
|
||||
|
||||
class _RepositoryVulkanDepsSubDirectory extends _RepositoryDirectory {
|
||||
_RepositoryVulkanDepsSubDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
|
||||
|
||||
@override
|
||||
bool shouldRecurse(fs.IoNode entry) {
|
||||
return entry.name == 'src';
|
||||
}
|
||||
|
||||
@override
|
||||
_RepositoryDirectory createSubdirectory(fs.Directory entry) {
|
||||
if (entry.name == 'src') {
|
||||
return _RepositoryVulkanDirectory(this, entry);
|
||||
}
|
||||
return super.createSubdirectory(entry);
|
||||
}
|
||||
}
|
||||
|
||||
class _RepositoryRootThirdPartyDirectory extends _RepositoryGenericThirdPartyDirectory {
|
||||
_RepositoryRootThirdPartyDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
|
||||
|
||||
@@ -1917,10 +1958,6 @@ class _RepositoryRootThirdPartyDirectory extends _RepositoryGenericThirdPartyDir
|
||||
&& entry.name != 'fontconfig' // not used in standard configurations
|
||||
&& entry.name != 'swiftshader' // only used on hosts for tests
|
||||
&& entry.name != 'shaderc' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license
|
||||
&& entry.name != 'glslang' // only used on hosts for tests
|
||||
&& entry.name != 'spirv_tools' // only used on hosts for tests
|
||||
&& entry.name != 'spirv_headers' // only used on hosts for tests
|
||||
&& entry.name != 'spirv_cross' // Used by impellerc with separate license and host tests. See //flutter/impeller/compiler:impellerc_license
|
||||
&& entry.name != 'ocmock' // only used for tests
|
||||
&& entry.name != 'java' // only used for Android builds
|
||||
&& entry.name != 'inja' // Only used by impellerc, which ships a separate license. See //flutter/impeller/compiler:impellerc_license
|
||||
@@ -1941,8 +1978,10 @@ class _RepositoryRootThirdPartyDirectory extends _RepositoryGenericThirdPartyDir
|
||||
return _RepositoryDartDirectory(this, entry);
|
||||
if (entry.name == 'expat')
|
||||
return _RepositoryExpatDirectory(this, entry);
|
||||
if (entry.name == 'externals')
|
||||
return _RepositoryThirdPartyExternalsDirectory(this, entry);
|
||||
if (entry.name == 'vulkan_memory_allocator')
|
||||
return _RepositoryVulkanMemoryAllocatorDirectory(this, entry);
|
||||
if (entry.name == 'vulkan-deps')
|
||||
return _RepositoryVulkanDepsDirectory(this, entry);
|
||||
if (entry.name == 'freetype-android')
|
||||
throw '//third_party/freetype-android is no longer part of this client: remove it';
|
||||
if (entry.name == 'freetype2')
|
||||
@@ -1990,18 +2029,6 @@ class _RepositoryThirdPartyWebDependenciesDirectory extends _RepositoryDirectory
|
||||
}
|
||||
}
|
||||
|
||||
/// Corresponds to the `src/third_party/externals` directory
|
||||
class _RepositoryThirdPartyExternalsDirectory extends _RepositoryDirectory {
|
||||
_RepositoryThirdPartyExternalsDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
|
||||
|
||||
@override
|
||||
_RepositoryDirectory createSubdirectory(fs.Directory entry) {
|
||||
if (entry.name == 'vulkanmemoryallocator')
|
||||
return _RepositoryVulkanMemoryAllocatorDirectory(this, entry);
|
||||
return super.createSubdirectory(entry);
|
||||
}
|
||||
}
|
||||
|
||||
class _RepositoryVulkanMemoryAllocatorDirectory extends _RepositoryDirectory {
|
||||
_RepositoryVulkanMemoryAllocatorDirectory(_RepositoryDirectory parent, fs.Directory io) : super(parent, io);
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
import("//build/fuchsia/sdk.gni")
|
||||
|
||||
config("vulkan_config") {
|
||||
include_dirs = []
|
||||
include_dirs = [ "//third_party/vulkan_memory_allocator/include" ]
|
||||
defines = [ "VULKAN_HPP_NO_EXCEPTIONS=1" ]
|
||||
if (is_fuchsia) {
|
||||
include_dirs += [ "//third_party/fuchsia-vulkan/include" ]
|
||||
defines += [ "VK_USE_PLATFORM_FUCHSIA=1" ]
|
||||
} else {
|
||||
include_dirs += [ "//third_party/vulkan-headers/include" ]
|
||||
include_dirs += [ "//third_party/vulkan-deps/vulkan-headers/src/include" ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,4 +65,7 @@ source_set("vulkan") {
|
||||
":vulkan_config",
|
||||
"//flutter:config",
|
||||
]
|
||||
|
||||
public_deps =
|
||||
[ "//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers" ]
|
||||
}
|
||||
|
||||