GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kommander/bun-webgpu: WebGPU (Dawn) FFI bindings for bun.

BranchesTags
Open more actions menu

Latest commit

 

History

237 Commits
237 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
dawn
dawn
 
 
scripts
scripts
 
 
src
src
 
 
tools
tools
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build-linux.sh
build-linux.sh
 
 
build-windows.ps1
build-windows.ps1
 
 
bun.lock
bun.lock
 
 
index.d.ts
index.d.ts
 
 
mise.toml
mise.toml
 
 
package.json
package.json
 
 
run-cts.sh
run-cts.sh
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

bun-webgpu

WebGPU (Dawn) FFI bindings for Bun.

Usage

import { setupGlobals } from 'bun-webgpu';

setupGlobals();

const adapter = navigator.gpu.requestAdapter();
const device = await adapter?.requestDevice();

// ... use WebGPU ...

Find out more about WebGPU types here.

Building

Note: There are prebuilt binaries in the pipeline artifacts.

Prerequisites

  • Bun: Ensure you have BunJS installed. (https://bun.sh)
  • Zig: The native components of this library are written in Zig. Ensure Zig is installed and available in your PATH. (https://ziglang.org/learn/getting-started/)
  • Pre-built Dawn Libraries: This project relies on pre-built Dawn libraries.
    • See packages/bun-webgpu/dawn/README.md for details on how to download the required Dawn shared libraries.
    • Basically just run bun run ./dawn/download_artifacts.ts

Building the FFI Liberary

The package.json includes scripts to build the native library components.

  • build:dev
  • build:prod

Conformance Test Suite (CTS)

To run the CTS, build the library first, then run the tests:

./run-cts.sh 'webgpu:api,operation,adapter,requestDevice:always_returns_device:*'

Run all webgpu tests for example with ./run-cts.sh 'webgpu:*'

Current results for webgpu:api,* are:

** Summary **
Passed  w/o warnings = 39994 / 51160 =  78.17%
Passed with warnings =     0 / 51160 =   0.00%
Skipped              =  8290 / 51160 =  16.20%
Failed               =  2876 / 51160 =   5.62%

Testing

To run tests, build the library first, then run the tests:

bun test

About

WebGPU (Dawn) FFI bindings for bun.

Resources

Readme
Apache-2.0 license
Activity

Stars

41 stars

Watchers

1 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.