Nothing Special   »   [go: up one dir, main page]

Skip to content

wgpu4k/wgpu4k

Repository files navigation

WGPU4K: A WebGPU Binding for Kotlin Multi-platform

Tests Static Badge Static Badge Static Badge Static Badge

This project focuses on creating a binding for WebGPU which can support Kotlin on multiple platforms.

Table of Contents

  1. Prerequisites
  2. How to run the demo projects from library sources
  3. Getting started
  4. Compatibility
  5. Backend
  6. Project Phases
    1. Proof of Concept
    2. API Implementation
    3. API Refinement
    4. Production

Prerequisites

  • Gradle 8.8
  • JDK 22+
  • A recent version of Chrome or Firefox Nightly for web browser execution. Check compatibility here.

How to run the demo projects from library sources

git clone https://github.com/wgpu4k/wgpu4k.git
cd wgpu4k
  • On desktop JVM: ./gradlew examples:glfw:run
  • On web js: ./gradlew examples:web-js:jsBrowserRun
  • On web wasm: ./gradlew examples:web-js:wasmJsBrowserRun
  • On desktop native (Mac only and still experimental) ./gradlew examples:native:runDebugExecutableNative
  • On android (experimental) ./gradlew wgpu4k:build to build the JNI library, then you can run the subproject android with android studio android-studio-capture.png
  • On iOS (experimental) ./gradlew examples:iOS:assembleWgpuAppXCFramework to build the XC Framework, then you can run the subproject iosApp with XCode on a iOS simulator or real device.

Use page down and page up on your keyboard to switch scene.

Getting started

Documentation will be added later, to start you can check out the minimalist project here or see scenes implemented to end-to-end tests here.

Compatibility

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

🔍 = Unsupported yet, open to contributions

❌ = Not applicable

Backend

On JVM we are using the firefox backend, see the GitHub page to get more information.

Project Phases

Proof of Concept

The current one, the aim of this phase is to test the technology on as many platforms as possible using elementary examples.

API Implementation

The entire API is implemented in this phase.

API Refinement

In this phase, the API is fine-tuned to be more idiomatic to Kotlin.

Production

This is the final phase when the project is ready for production.