Skip to content

Study examples for WebGPU using the wgpu crate in Rust

Notifications You must be signed in to change notification settings

kylestew/LearnWGPU-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LearnWGPU-Rust

Study examples for WebGPU using the wgpu crate in Rust

Examples layout (Cargo examples)

This repo uses Cargo's examples/ convention. Each example lives in its own folder as a mini-crate with a main.rs (and optional assets/shaders).

Current examples

  • 01-clear-display: examples/01-clear-display/main.rs – clears the window to BLUE

Example 01 - Clear Display

Shows the minimal setup to acquire a surface, configure it, and clear the window every frame.

  • Run:
    cargo run --example 01-clear-display
  • Expected result: a blue window like below

Example 01: Clear Display

Add a new example

  1. Create a new folder under examples/<your-example>/.
  2. Add a main.rs inside that folder.
  3. Use an existing example as a template and change what you need (e.g., clear color, pipeline, etc.).
  4. Run it via:
    cargo run --example <your-example>

Build all examples

cargo build --examples

Logging

These examples use env_logger. To adjust verbosity:

RUST_LOG=info cargo run --example 01-clear-display

About

Study examples for WebGPU using the wgpu crate in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published