Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wumpf/minifb_wgpu_web_and_desktop
Minimal example for wgpu + minifb, targeting both native & web
https://github.com/wumpf/minifb_wgpu_web_and_desktop
webgpu wgpu
Last synced: 26 days ago
JSON representation
Minimal example for wgpu + minifb, targeting both native & web
- Host: GitHub
- URL: https://github.com/wumpf/minifb_wgpu_web_and_desktop
- Owner: Wumpf
- Created: 2024-09-08T19:29:36.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T19:36:05.000Z (2 months ago)
- Last Synced: 2024-09-08T21:01:03.460Z (2 months ago)
- Topics: webgpu, wgpu
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Minimal [`wgpu`](https://github.com/gfx-rs/wgpu) and [`minifb`](https://github.com/emoon/rust_minifb) example for web & desktop
================================================This is a minimal example of how to use [`wgpu`](https://github.com/gfx-rs/wgpu) and [`minifb`](https://github.com/emoon/rust_minifb) to render a triangle on the screen.
![image](https://github.com/user-attachments/assets/89bce01d-3e96-435e-b897-038fa1cee340)
Run on desktop
--------------```sh
cargo run
```Run on web
----------```sh
cargo xtask run-wasm
```This executes an xtask that builds the wasm binary and launches a web server.
Known issues & limitations
--------------------------* A bunch of fixes to `minifb` are required which haven't been released yet (as of writing). This project therefore depends on a specific commit of `minifb` for now.
* Chrome(ium) on Linux incorrectly reports WebGPU support, causing the application to crash on startup.
This will likely be addressed in a future release of `wgpu` using a new `wgpu::util::new_instance_with_webgpu_detection` utility method, see https://github.com/gfx-rs/wgpu/pull/6371