wgpu/examples
Connor Fitzgerald 10172e1f38
Move Examples and Tests to Their Own Crates (#3841)
Co-authored-by: Connor Fitzgerald <connor@modyfi.io>
2023-06-10 18:35:46 +00:00
..
boids Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
bunnymark Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
capture Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
common Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
conservative-raster Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
cube Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
hello Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
hello-compute Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
hello-triangle Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
hello-windows Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
mipmap Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
msaa-line Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
shadow Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
skybox Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
stencil-triangles Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
texture-arrays Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
water Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
README.md Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00

Structure

For the simplest examples without using any helping code (see framework.rs here), check out:

  • hello for printing adapter information
  • hello-triangle for graphics and presentation
  • hello-compute for pure computing

Notably, capture example shows rendering without a surface/window. It reads back the contents and saves them to a file.

All the examples use WGSL shaders unless specified otherwise.

All framework-based examples render to the window and are reftested against the screenshot in the directory.

Feature matrix

Feature boids bunnymark cube mipmap msaa-line shadow skybox texture-arrays water conservative-raster stencil-triangles
vertex attributes
instancing
lines and points
dynamic buffer offsets
implicit layout
sampled color textures
storage textures
comparison samplers
subresource views
cubemaps
multisampling
off-screen rendering
stencil testing
depth testing
depth biasing
read-only depth
blending
render bundles
compute passes
error scopes
optional extensions
- SPIR-V shaders
- binding array
- push constants
- depth clamping
- compressed textures
- polygon mode
- queries
- conservative rasterization
integrations
- staging belt
- typed arena
- obj loading

Hacking

You can record an API trace any of the framework-based examples by starting them as:

mkdir -p trace && WGPU_TRACE=trace cargo run --features trace --example <example-name>