Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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