
Native WebGPU binding wrapping gfx-rs wgpu-native, offering low-level WebGPU API, example apps and demos, API reference, and straightforward integration for native projects.
This project is a WebGPU binding compatible with Desktop and Mobile.
If you are looking for an experience that also covers the web, you can use the wgpu4k project.
This library uses the Firefox backend written in Rust, available here.
./gradlew demo:desktop-and-ios:runJvm
./gradlew demo:desktop-and-ios:runDebugExecutable
android with android studio or IntelliJ IDEA!./gradlew build, then run the subproject android-native with android studio or IntelliJ IDEA!./gradlew demo:desktop-and-ios:assembleWgpuAppXCFramework to build the XC Framework, then you can run the subproject iosApp (on demo/desktop-and-ios folder) with XCode on a iOS simulator or real device.From a basic multiplatform project, create a common native source set and add the library:
private val hierarchyTemplate = KotlinHierarchyTemplate {
/* natural hierarchy is only applied to default 'main'/'test' compilations (by default) */
withSourceSetTree(KotlinSourceSetTree.main, KotlinSourceSetTree.test)
common {
/* All compilations shall be added to the common group by default */
withCompilations { true }
group("commonNative") {
group("native") {
withNative()
group("apple") {
withApple()
group("ios") {
withIos()
}
group("tvos") {
withTvos()
}
group("watchos") {
withWatchos()
}
group("macos") {
withMacos()
}
}
group("linux") {
withLinux()
}
group("mingw") {
withMingw()
}
}
withJvm()
withAndroidTarget()
}
}
}
kotlin {
...
jvm {
compilerOptions {
jvmTarget = JvmTarget.JVM_24
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
macosArm64()
macosX64()
linuxArm64()
linuxX64()
mingwX64()
androidTarget {
compilerOptions {
jvmTarget = JvmTarget.JVM_24
}
publishLibraryVariants("release", "debug")
}
applyHierarchyTemplate(hierarchyTemplate)
sourceSets {
...
val commonNativeMain by getting {
dependencies { api("io.ygdrasil:wgpu4k-native:<library version>) }
}
...
}
...
}This project is a WebGPU binding compatible with Desktop and Mobile.
If you are looking for an experience that also covers the web, you can use the wgpu4k project.
This library uses the Firefox backend written in Rust, available here.
./gradlew demo:desktop-and-ios:runJvm
./gradlew demo:desktop-and-ios:runDebugExecutable
android with android studio or IntelliJ IDEA!./gradlew build, then run the subproject android-native with android studio or IntelliJ IDEA!./gradlew demo:desktop-and-ios:assembleWgpuAppXCFramework to build the XC Framework, then you can run the subproject iosApp (on demo/desktop-and-ios folder) with XCode on a iOS simulator or real device.From a basic multiplatform project, create a common native source set and add the library:
private val hierarchyTemplate = KotlinHierarchyTemplate {
/* natural hierarchy is only applied to default 'main'/'test' compilations (by default) */
withSourceSetTree(KotlinSourceSetTree.main, KotlinSourceSetTree.test)
common {
/* All compilations shall be added to the common group by default */
withCompilations { true }
group("commonNative") {
group("native") {
withNative()
group("apple") {
withApple()
group("ios") {
withIos()
}
group("tvos") {
withTvos()
}
group("watchos") {
withWatchos()
}
group("macos") {
withMacos()
}
}
group("linux") {
withLinux()
}
group("mingw") {
withMingw()
}
}
withJvm()
withAndroidTarget()
}
}
}
kotlin {
...
jvm {
compilerOptions {
jvmTarget = JvmTarget.JVM_24
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
macosArm64()
macosX64()
linuxArm64()
linuxX64()
mingwX64()
androidTarget {
compilerOptions {
jvmTarget = JvmTarget.JVM_24
}
publishLibraryVariants("release", "debug")
}
applyHierarchyTemplate(hierarchyTemplate)
sourceSets {
...
val commonNativeMain by getting {
dependencies { api("io.ygdrasil:wgpu4k-native:<library version>) }
}
...
}
...
}