Skip to content

Commit 6a2e0d8

Browse files
committed
fix: disable vulkan for windows android emulators
1 parent bbce18f commit 6a2e0d8

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ jobs:
417417
"-no-snapshot-save",
418418
"-wipe-data",
419419
"-gpu", "swiftshader_indirect",
420+
"-feature", "-Vulkan",
420421
"-grpc", "8554",
421422
"-port", "5554",
422423
"-no-metrics",

packages/server/src/android.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,22 +320,26 @@ impl AndroidBridge {
320320
}
321321
let grpc_port = self.grpc_port_for_avd(&avd_name)?;
322322
let grpc_port = grpc_port.to_string();
323-
let window_mode = if cfg!(target_os = "windows") {
323+
let is_windows = cfg!(target_os = "windows");
324+
let window_mode = if is_windows {
324325
"-qt-hide-window"
325326
} else {
326327
"-no-window"
327328
};
329+
let mut args = vec![
330+
"-avd",
331+
&avd_name,
332+
window_mode,
333+
"-no-audio",
334+
"-gpu",
335+
"swiftshader_indirect",
336+
];
337+
if is_windows {
338+
args.extend(["-feature", "-Vulkan"]);
339+
}
340+
args.extend(["-grpc", &grpc_port]);
328341
Command::new(self.emulator_path())
329-
.args([
330-
"-avd",
331-
&avd_name,
332-
window_mode,
333-
"-no-audio",
334-
"-gpu",
335-
"swiftshader_indirect",
336-
"-grpc",
337-
&grpc_port,
338-
])
342+
.args(args)
339343
.stdin(Stdio::null())
340344
.stdout(Stdio::null())
341345
.stderr(Stdio::null())

scripts/github-actions.test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ test("Windows Android CI boot path is bounded and diagnostic", () => {
8383
assert.match(windowsBootStep, /\$accelSupported = \$LASTEXITCODE -eq 0/);
8484
assert.match(windowsBootStep, /google_atd/);
8585
assert.match(windowsBootStep, /"-qt-hide-window"/);
86+
assert.match(windowsBootStep, /"-feature", "-Vulkan"/);
8687
assert.match(windowsBootStep, /"-accel", "on"/);
8788
assert.match(windowsBootStep, /"-accel", "off"/);
8889
assert.match(windowsBootStep, /-RedirectStandardOutput \$stdout/);

0 commit comments

Comments
 (0)