Repository navigation
fix(wasm): Link SkiaSharp's emdawnwebgpu when it brings one - #26254
Merged
ramezgerges merged 3 commits intoNov 9, 2026
Merged
ramezgerges merged 3 commits into
ramezgerges merged 3 commits into
Conversation
SkiaSharp 4.155+ links its own copy of Dawn's emdawnwebgpu into every
WebAssembly app. With Uno's WebGPU port also linked, emcc loads the same
JS libraries twice and the link fails ("Identifier 'structInfo32' has
already been declared"). Both copies are the same release and the same
standard webgpu.h ABI, so drop Uno's port when SkiaSharp provides one.
WebGpuInit.ts now reaches emdawnwebgpu through Module.WebGPU, which both
copies export, instead of the Module aliases only Uno's patched copy had.
Fixes unoplatform#26253
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
5 tasks
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Decide at link time whether Uno's port is needed instead of adding it while the project loads and removing it again when SkiaSharp brings its own copy. This also leaves out Uno's -sDEFAULT_TO_CXX=1 in that case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Uno's targets point emcc at a writable cache, seeded with a copy of the SDK's (400-500 MB), only so emcc can build Uno's emdawnwebgpu port. When SkiaSharp links its own copy there is no port to build, so keep the app's cache, the SDK's frozen one by default, as an app with SkiaSharp alone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26254/docs/index.html |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
jonpryor
approved these changes
Nov 9, 2026
ramezgerges
enabled auto-merge
November 9, 2026 18:54
ajpinedam
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #26253
PR Type:
🐞 Bugfix
What changed? 🚀
SkiaSharp 4.155+ links its own copy of Dawn's emdawnwebgpu into every WebAssembly app. Uno's WebGPU backend links the same emdawnwebgpu release through
--use-port, so an app with both Skia and the WebGPU backend (the SamplesApp always has both) loads the same four JS libraries twice and the link fails:This blocks the SkiaSharp bump in #26165 (#26179).
Both copies are the same Dawn release (v20260624.223603), and their
webgpu.hmatches the standard header Uno's binding is generated from: the same 202 functions, 86 struct layouts and 493 enum values. So when SkiaSharp brings a copy, Uno now links that one instead of its own:Uno.WinUI.Composition.WebGpu.targets:_UnoWebGpuLinkEmdawnadds Uno's--use-port(and-sDEFAULT_TO_CXX=1) at link time, and only when SkiaSharp doesn't link emdawnwebgpu itself. That check covers both 4.155, which passes link flags, and 4.156+, which addsjs-librarycontent. It runs in a target because SkiaSharp's properties may not be set yet while the project loads._UnoWebGpuExportRuntimeObjectexports theWebGPUruntime method, deduplicated against SkiaSharp's export.WebGpuInit.tsimports the JS-created device and offscreen texture, and resolves readback buffers, through the stockModule.WebGPU(importJsDevice,importJsTexture,Internals.jsObjects). Both copies export it. Before, it used aliases that only Uno's patched copy defined.wgpu-wasm.targetsno longer adds those aliases. It keeps thestackSave/stackRestorepatch, which SkiaSharp's copy carries too.Apps on SkiaSharp without emdawnwebgpu (4.151.1, today's default), and WebGPU apps without Skia, keep linking Uno's copy.
Validation:
Build Wasm Skia Headcommand) on this branch, with-p:SkiaSharpVersion=4.156.0-rc.1.26553.11and with the default 4.151.1.--use-portor-sDEFAULT_TO_CXX.WebGPUonce.env=UNO_WEBGPU=1,Given_RenderTargetBitmappassed 6/6 on both builds. Those tests cover device import, offscreen texture import and buffer readback.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code