Skip to content

Link XDL's prebuilt emdawnwebgpu instead of the port, so browser apps need no writable Emscripten cache - #3

Merged
stanoddly merged 1 commit into
mainfrom
browser-prebuilt-emdawnwebgpu
Nov 9, 2026
Merged

stanoddly merged 1 commit into
mainfrom
browser-prebuilt-emdawnwebgpu

Conversation

@botoddly

@botoddly botoddly commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

XdlSharp.Native.browser-wasm added --use-port=emdawnwebgpu to the link. The port compiles webgpu.cpp into the Emscripten cache at link time, and the wasm-tools workload's cache is read-only, so every browser app had to set WasmCachePath to a writable copy of it.

Change

  • XDL_VERSION is 3.4.20-9, whose browser zip ships emdawnwebgpu prebuilt: emdawnwebgpu.a and its four JavaScript libraries (Ship emdawnwebgpu prebuilt in the browser zip so .NET apps link without a writable Emscripten cache XDL#27).
  • The package's targets link emdawnwebgpu.a with ScanForPInvokes="false" and pass the JavaScript libraries with --js-library in the port's order, instead of --use-port=emdawnwebgpu.
  • Both browser test projects drop WasmCachePath, so CI links with the workload's read-only cache, as an app does.
  • XdlBrowserDirectory moves to Directory.Build.props, because XdlSharp.Browser.Tests now reads it in a property, which Directory.Build.targets is evaluated too late for.
  • The README drops the writable cache and names the two exports a page needs to hand XDL a WebGPU device.

Tested locally

  • The generated bindings match the 3.4.20-9 headers (--check --clang clang-22).
  • XdlSharp.Tests: 15 passed.
  • XdlSharp.Browser.Tests under Node: 14 passed.
  • tools/pack.sh, then XdlSharp.Package.Browser.Tests with the packed packages: all four libraries load, no archive or JavaScript library lands in the published output, and emdawnwebgpu is not in the P/Invoke table.
  • The workload's Emscripten cache is unchanged after each link.

@stanoddly
stanoddly merged commit 64ec5f3 into main Nov 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants