Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
enable_embedded_wasm_sdk_build: true
wasm_exclude_swift_versions: '[{"swift_version": "nightly-6.2"}]'
enable_linux_checks: false
enable_macos_checks: false
enable_windows_checks: false
Expand Down
5 changes: 2 additions & 3 deletions WebGPUDemo/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion WebGPUDemo/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let package = Package(
),
.package(
url: "https://github.com/swiftwasm/JavaScriptKit.git",
from: "0.33.1",
revision: "0b785610d170a0cbb4777ea379cb7221fc82c401",
),
],
targets: [
Expand Down
20 changes: 5 additions & 15 deletions WebGPUDemo/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
# WebGPU Example

Install Swift 6.2 development snapshot and Swift SDK for Wasm by following
https://www.swift.org/documentation/articles/wasm-getting-started.html.
Install Swift 6.2 (or later version) and a corresponding Swift SDK for Wasm by following
["Getting Started with Swift SDKs for WebAssembly" article](https://www.swift.org/documentation/articles/wasm-getting-started.html).

Build with the installed Swift SDK using JavaScriptKit's `PackageToJSPlugin` plugin. Make sure to update
the Swift SDK in the following command to the version that matches your installed swift.org toolchain.
the Swift SDK in the following command to the version that matches your installed Swift toolchain.
```
swift package --swift-sdk swift-6.2-DEVELOPMENT-SNAPSHOT-2025-06-17-a_wasm js --use-cdn
swift package --swift-sdk swift-6.2-RELEASE_wasm js --use-cdn
```

If you'd like to produce a smaller binary (under 400 kB), you'll have to use
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kateinoigakukun removing this due to swiftwasm/JavaScriptKit@04c9e5e (SuspendingClock and ContinuousClock are unavailable in Embedded Swift)

`swift-DEVELOPMENT-SNAPSHOT-2025-08-11` or later development snapshot of the `main` Swift toolchain
branch. Earlier versions (including Swift 6.2) have no support for `async` functions in Embedded Swift,
which is required for WebGPU setup. Use the following command to build with Embedded Swift (update for
your installed toolchain version if needed):

```
swift package --swift-sdk swift-DEVELOPMENT-SNAPSHOT-2025-08-11-a_wasm-embedded js --use-cdn -c release
```

WebGPU is enabled by default in beta and technical preview versions of Safari. Safari 17 and 18 require enabling
WebGPU is enabled by default in Safari 26. Safari 17 and 18 require enabling
WebGPU feature flag as shown on the screenshot:

<img width="833" alt="Safari Feature Flags settings tab with WebGPU enabled" src="https://github.com/user-attachments/assets/7d0453ab-da51-4a6e-85da-dc466cf775be" />
Expand Down
Loading