Files
wgpu/wgpu/examples
Samuel Hurel 3e0305d27d Allow non struct buffers in wgsl (#2451)
* Bump naga

* Update examples
2022-02-05 09:53:04 -05:00
..
2021-11-19 10:56:48 -05:00
2021-10-07 16:18:09 -04:00
2022-01-22 18:36:26 -05:00
2021-10-07 16:18:09 -04:00
2022-01-22 18:36:26 -05:00
2022-01-22 18:36:26 -05:00
2022-01-22 18:36:26 -05:00
2022-01-22 18:36:26 -05:00
2021-10-07 16:18:09 -04:00
2021-12-17 04:39:48 +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
vertex attributes
instancing
lines and points
dynamic buffer offsets
implicit layout
sampled color textures
storage textures
binding array
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 indexing
- 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>