Skip to content

Commit fd42539

Browse files
authored
devops: fix swiftshader on Chromium Windows (#6391)
References #6390
1 parent dddfbaa commit fd42539

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

browser_patches/chromium/archive.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ function archive_compiled_chromium() {
136136

137137
if [[ $1 == "--compile-win"* ]]; then
138138
$COPY_COMMAND "${CR_CHECKOUT_PATH}/src/out/Default/"*.manifest "output/${CHROMIUM_FOLDER_NAME}/"
139+
# See https://github.com/microsoft/playwright/issues/6390
140+
node "${SCRIPT_PATH}/fix_windows_swiftshader.js" "output/${CHROMIUM_FOLDER_NAME}/vk_swiftshader_icd.json"
139141
fi
140142

141143
cd output
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// See https://github.com/microsoft/playwright/issues/6390
2+
const fs = require('fs');
3+
4+
const FILE_PATH = process.argv[2];
5+
if (!fs.existsSync(FILE_PATH) || !FILE_PATH.endsWith('.json'))
6+
return;
7+
8+
const json = JSON.parse(fs.readFileSync(FILE_PATH, 'utf8'));
9+
10+
if (json.ICD && json.ICD.library_path && json.ICD.library_path.startsWith('.\\')) {
11+
json.ICD.library_path = json.ICD.library_path.substring(2);
12+
fs.writeFileSync(FILE_PATH, JSON.stringify(json), 'utf8');
13+
}

0 commit comments

Comments
 (0)