Skip to content
forked from wgpu4k/wgpu4k

webgpu binding for kotlin multi platform

License

Notifications You must be signed in to change notification settings

ygdrasil-io/wgpu4k

 
 

Repository files navigation

WGPU4K: A WebGPU Binding for Kotlin Multi-platform

Tests Status Latest Version License Discord

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.


Table of Contents

  1. Prerequisites
  2. How to Execute Examples
  3. Getting Started
  4. Compatibility
  5. Backend
  6. Project Phases

Prerequisites

  • Gradle: 8.11+
  • JDK: 22+
  • Web Browsers: A recent version of Chrome or Firefox Nightly (check compatibility here).

How to Execute Examples

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).

Tip: Use Page Down and Page Up on your keyboard to switch scenes while running examples.


Getting Started

Documentation is on its way!
For now:


Compatibility

Target Windows Linux MacOS iOS Android
JVM x64 🆗 🆗 🛠️
JVM arm64 🔍️ 🆗 🛠️
JS 🆗 ❓️
wasm 🆗️ 🆗️ 🆗️ ❓️ ❓️
native x64 🛠️ 🔍️ 🛠️ 🛠️ ❌️️
native arm64 🔍️ 🔍️ 🛠️ 🛠️ ❌️️

Key:

  • ✅ = First class citizen
  • 🆗 = Best effort
  • ❓ = Untested, could work
  • 🛠️ = Work in progress
  • 🔍 = Not supported yet (open to contributions)
  • ❌ = Not applicable

Backend

The native backend uses Firefox WebGPU. For more details, visit the GitHub page.


Project Phases

Completed

  • Proof of Concept (Done): Successfully tested WebGPU across multiple platforms using basic examples.

In Progress

  1. API Implementation: Developing the entire API.
  2. API Refinement: Making the API more idiomatic to Kotlin.

Upcoming

  • Production: Preparing the project for production use.

About

webgpu binding for kotlin multi platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 99.3%
  • Other 0.7%