Skip to content

richerfu/wgpu-demo-with-winit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WGPU (24.0.1) + Winit (0.30.8) Template

This is a template repository to get started with WGPU (24.0.1) + Winit (0.30.8).

The template supports cross-platform compilation for Windows, Linux, MacOS and WebAssembly, utilizing WebGPU/WebGL with trunk.

Quickstart

# Clone the repository and open it
git clone https://github.com/Foxicution/wgpu-template
cd wgpu-template

# To run natively (Windows/MacOS/Linux)
cargo run

# To run on the web with WebAssembly (WASM)
# Add target wasm32-unknown-unknown for WASM builds
rustup target add wasm32-unknown-unknown

# Install trunk for WASM builds
cargo install --locked trunk

# With WebGL (for browsers that don't support WebGPU)
trunk serve --features webgl --open
# With WebGPU
trunk serve --open

For web builds, the app will be running on http://localhost:8080.

To check if your browser supports WebGPU go here.

Contributing

If you run into any issues while using the template, feel free to submit a Github issue or a Pull Request.

Resources

References and projects that helped create this template:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published