Skip to content

[4.155] Pass -sUSE_WEBGPU to Uno WASM heads only on net8.0 - #5835

Merged
mattleibow merged 1 commit into
mono:release/4.155.xfrom
ramezgerges:dev/backport-4.155-uno-wasm-webgpu
Nov 19, 2026
Merged

mattleibow merged 1 commit into
mono:release/4.155.xfrom
ramezgerges:dev/backport-4.155-uno-wasm-webgpu

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

Description

An Uno Platform 6.x WebAssembly app on the native renderer that uses SkiaSharp fails to link on 4.155 with:

To use Dawn's library_webgpu.js, disable -sUSE_WEBGPU

On .NET 9+ the WebAssembly block of SkiaSharp.targets links Dawn's emdawnwebgpu port. Uno 6.x builds on the .NET WebAssembly SDK, so that block applies to Uno heads too, but the Uno block also added -s USE_WEBGPU=1 unconditionally (since #3968). emsdk's built-in WebGPU port and Dawn's library_webgpu.js can't be linked together.

Only net8.0 (emsdk 3.1.34) still uses the built-in port, so the Uno block now adds the flag only there. This mirrors the .NET block, which already passes -s USE_WEBGPU=1 only when emdawnwebgpu isn't used.

This is 4.155-only. On main the Uno block was removed with the Uno 7 move (#5377) and .NET 8 WebAssembly is no longer built, so USE_WEBGPU no longer appears there. #5377 itself isn't backportable because 4.155 still supports Uno 6.x.

Related issues

Related to #5797 (reported while testing the 4.155 backports with Uno Platform 6.7; the block is unchanged since 4.155.0, so that PR didn't introduce it).

Required skia PR

None.

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

Behavior

Uno WASM heads targeting net9.0/net10.0 no longer get -s USE_WEBGPU=1 and link again. net8.0 heads are unchanged.

Testing

Evaluated the targets with dotnet msbuild -getItem:WasmShellExtraEmccFlags for an Uno WASM head (IsUnoHead=True, UnoRuntimeIdentifier=WebAssembly):

TFM .NET WebAssembly SDK -s USE_WEBGPU=1
net8.0 yes / no added
net9.0 yes / no not added
net10.0 yes / no not added

-s USE_WEBGL2=1 and the other Uno flags are unchanged in every case. I didn't run a full Uno link locally; the reporter confirmed that removing only this flag makes the Uno 6.7 app link and run. 4.155 has no MSBuild targets test project to add a regression test to (main's WasmNativeReferenceTests already asserts the flag is absent).

Checklist

  • Tests added or updated (if omitted, explain why above)
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? Added or updated accurate source /// documentation and regenerated bindings when applicable
  • Native change? Companion mono/skia PR linked above and bindings regenerated

🤖 Generated with Claude Code

On .NET 9+ the WebAssembly block links Dawn's emdawnwebgpu port, whose
library_webgpu.js refuses to link with emsdk's -sUSE_WEBGPU. The Uno
block added that flag unconditionally, so an Uno 6.x WASM app with the
Skia renderer failed to link with "To use Dawn's library_webgpu.js,
disable -sUSE_WEBGPU". Only net8.0 (emsdk 3.1.34) still uses the
built-in WebGPU port, so add the flag only there. Main no longer has the
flag at all (the Uno block went with the Uno 7 move in mono#5377, and .NET 8
WASM support was dropped).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5835

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5835"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5835/packages --name skiasharp-pr-5835
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-5835

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @ramezgerges! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@mattleibow
mattleibow enabled auto-merge (squash) November 19, 2026 03:19
@mattleibow
mattleibow merged commit 528d6af into mono:release/4.155.x Nov 19, 2026
112 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in SkiaSharp Backlog Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants