Skip to content

Commit

Permalink
devops: fix swiftshader on Chromium Windows (#6391)
Browse files Browse the repository at this point in the history
References #6390
  • Loading branch information
aslushnikov authored May 3, 2021
1 parent dddfbaa commit fd42539
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions browser_patches/chromium/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ function archive_compiled_chromium() {

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

cd output
Expand Down
13 changes: 13 additions & 0 deletions browser_patches/chromium/fix_windows_swiftshader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// See https://github.com/microsoft/playwright/issues/6390
const fs = require('fs');

const FILE_PATH = process.argv[2];
if (!fs.existsSync(FILE_PATH) || !FILE_PATH.endsWith('.json'))
return;

const json = JSON.parse(fs.readFileSync(FILE_PATH, 'utf8'));

if (json.ICD && json.ICD.library_path && json.ICD.library_path.startsWith('.\\')) {
json.ICD.library_path = json.ICD.library_path.substring(2);
fs.writeFileSync(FILE_PATH, JSON.stringify(json), 'utf8');
}

0 comments on commit fd42539

Please sign in to comment.