Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '5cab8e095066d8f3de063943af26b7336aa52662',
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'aee1094b10465e32972932e23b6799c3f8de244f',

# Fuchsia compatibility
#
Expand Down
7 changes: 5 additions & 2 deletions ci/builders/mac_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"debug",
"--no-lto",
"--prebuilt-dart-sdk",
"--build-embedder-examples"
"--build-embedder-examples",
"--enable-impeller-vulkan",
"--use-glfw-swiftshader"
],
"name": "host_debug",
"ninja": {
Expand Down Expand Up @@ -146,7 +148,8 @@
"--no-lto",
"--prebuilt-dart-sdk",
"--build-embedder-examples",
"--enable-impeller-vulkan"
"--enable-impeller-vulkan",
"--use-glfw-swiftshader"
],
"name": "host_release",
"ninja": {
Expand Down
5 changes: 5 additions & 0 deletions impeller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//third_party/glfw/glfw_args.gni")
import("tools/impeller.gni")

config("impeller_public_config") {
Expand Down Expand Up @@ -101,6 +102,10 @@ impeller_component("impeller_unittests") {
deps += [ "//flutter/impeller/renderer/backend/vulkan:vulkan_unittests" ]
}

if (glfw_vulkan_library != "") {
deps += [ "//third_party/swiftshader" ]
}

if (impeller_enable_compute) {
deps += [ "renderer:compute_tessellation_unittests" ]
}
Expand Down
1 change: 1 addition & 0 deletions impeller/playground/playground.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void Playground::SetupContext(PlaygroundBackend backend) {

impl_ = PlaygroundImpl::Create(backend, switches_);
if (!impl_) {
FML_LOG(WARNING) << "PlaygroundImpl::Create failed.";
return;
}

Expand Down
42 changes: 20 additions & 22 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import sys
import tempfile
import time
import typing
import xvfb

SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -56,13 +57,13 @@ def is_asan(build_dir):


def run_cmd(
cmd,
forbidden_output=None,
expect_failure=False,
env=None,
allowed_failure_output=None,
cmd: typing.List[str],
forbidden_output: typing.List[str] = None,
expect_failure: bool = False,
env: typing.Dict[str, str] = None,
allowed_failure_output: typing.List[str] = None,
**kwargs
):
) -> None:
if forbidden_output is None:
forbidden_output = []
if allowed_failure_output is None:
Expand All @@ -71,12 +72,13 @@ def run_cmd(
command_string = ' '.join(cmd)

print_divider('>')
print('Running command "%s"' % command_string)
print(f'Running command "{command_string}"')

start_time = time.time()
collect_output = forbidden_output or allowed_failure_output
stdout_pipe = sys.stdout if not collect_output else subprocess.PIPE
stderr_pipe = sys.stderr if not collect_output else subprocess.PIPE

process = subprocess.Popen(
cmd,
stdout=stdout_pipe,
Expand All @@ -92,15 +94,14 @@ def run_cmd(
print_divider('!')

print(
'Failed Command:\n\n%s\n\nExit Code: %d\n' %
(command_string, process.returncode)
f'Failed Command:\n\n{command_string}\n\nExit Code: {process.returncode}\n'
)

if stdout:
print('STDOUT: \n%s' % stdout)
print(f'STDOUT: \n{stdout}')

if stderr:
print('STDERR: \n%s' % stderr)
print(f'STDERR: \n{stderr}')

print_divider('!')

Expand All @@ -111,9 +112,8 @@ def run_cmd(
allowed_failure = True

if not allowed_failure:
raise Exception(
'Command "%s" exited with code %d.' %
(command_string, process.returncode)
raise RuntimeError(
f'Command "{command_string}" exited with code {process.returncode}.'
)

if stdout or stderr:
Expand All @@ -123,15 +123,13 @@ def run_cmd(
for forbidden_string in forbidden_output:
if (stdout and forbidden_string in stdout) or (stderr and
forbidden_string in stderr):
raise Exception(
'command "%s" contained forbidden string %s' %
(command_string, forbidden_string)
raise RuntimeError(
f'command "{command_string}" contained forbidden string {forbidden_string}'
)

print_divider('<')
print(
'Command run successfully in %.2f seconds: %s' %
(end_time - start_time, command_string)
f'Command run successfully in {end_time - start_time:.2f} seconds: {command_string}'
)


Expand Down Expand Up @@ -225,7 +223,7 @@ def run_engine_executable( # pylint: disable=too-many-arguments
expect_failure=False,
coverage=False,
extra_env=None,
gtest=False
gtest=False,
):
if executable_filter is not None and executable_name not in executable_filter:
print('Skipping %s due to filter.' % executable_name)
Expand Down Expand Up @@ -282,7 +280,7 @@ def run_engine_executable( # pylint: disable=too-many-arguments
forbidden_output=forbidden_output,
expect_failure=expect_failure,
env=env,
allowed_failure_output=allowed_failure_output
allowed_failure_output=allowed_failure_output,
)
except:
# The LUCI environment may provide a variable containing a directory path
Expand Down Expand Up @@ -503,7 +501,7 @@ def make_test(name, flags=None, extra_env=None):
build_dir,
'impeller_unittests',
executable_filter,
['--gtest_filter=-*/Vulkan'] + shuffle_flags,
shuffle_flags,
coverage=coverage,
extra_env=extra_env,
# TODO(117122): Remove this allowlist.
Expand Down
10 changes: 10 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ def to_gn_args(args):
if malioc_path:
gn_args['impeller_malioc_path'] = malioc_path

if args.use_glfw_swiftshader:
gn_args['glfw_vulkan_library'] = r'\"libvk_swiftshader.dylib\"'

# ANGLE is exclusively used for:
# - Windows at runtime
# - Non-fuchsia host unit tests (is_host_build evaluates to false).
Expand Down Expand Up @@ -1124,6 +1127,13 @@ def parse_args(args):
'in //flutter/tools/gn.',
)

parser.add_argument(
'--use-glfw-swiftshader',
default=False,
action='store_true',
help='Forces glfw to use swiftshader.',
)

return parser.parse_args(args)


Expand Down