This project focuses on creating a binding for WebGPU across Web, Desktop, and Mobile.
For a low-level library that supports Mobile and Desktop, check out wgpu4k-native.
- Gradle: 8.11+
- JDK: 22+
- Web Browsers: A recent version of Chrome or Firefox Nightly (check compatibility here).
git clone https://github.com/wgpu4k/wgpu4k.git
cd wgpu4k
- Desktop JVM:
./gradlew examples:glfw:run
- Web JS:
./gradlew examples:web-js:jsBrowserRun
- Web Wasm:
./gradlew examples:web-js:wasmJsBrowserRun
- Mac Native (Experimental):
./gradlew examples:native:runDebugExecutableNative
- Android (Experimental): Execute the
android
subproject via Android Studio. - iOS (Experimental):
- Build XCFramework:
./gradlew examples:iOS:assembleWgpuAppXCFramework
. - Run the
iosApp
subproject with XCode (compatible with a simulator or real device).
- Build XCFramework:
Tip: Use
Page Down
andPage Up
on your keyboard to switch scenes while running examples.
Documentation is on its way!
For now:
- Check out the minimalist project: Hello Cube
- Explore implemented scenes: Examples/Scenes.
Target | Windows | Linux | MacOS | iOS | Android |
---|---|---|---|---|---|
JVM x64 | ✅ | 🆗 | 🆗 | ❌ | 🛠️ |
JVM arm64 | 🔍️ | 🆗 | ✅ | ❌ | 🛠️ |
JS | ✅ | 🆗 | ✅ | ❓ | ❓️ |
wasm | 🆗️ | 🆗️ | 🆗️ | ❓️ | ❓️ |
native x64 | 🛠️ | 🔍️ | 🛠️ | 🛠️ | ❌️️ |
native arm64 | 🔍️ | 🔍️ | 🛠️ | 🛠️ | ❌️️ |
- ✅ = First class citizen
- 🆗 = Best effort
- ❓ = Untested, could work
- 🛠️ = Work in progress
- 🔍 = Not supported yet (open to contributions)
- ❌ = Not applicable
The native backend uses Firefox WebGPU. For more details, visit the GitHub page.
- Proof of Concept (Done): Successfully tested WebGPU across multiple platforms using basic examples.
- API Implementation: Developing the entire API.
- API Refinement: Making the API more idiomatic to Kotlin.
- Production: Preparing the project for production use.