wgpu/examples
Valaphee The Meerkat 494ae1a815
Add support for occlusion queries (#3402)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-08-02 19:05:59 +00:00
..
boids Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
bunnymark Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
capture Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
common refactor(wasm): remove unnecessary JsCast import 2023-07-25 17:05:28 -04:00
conservative-raster Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
cube Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
hello Formatting and example command fixes (#3872) 2023-06-15 20:05:26 +00:00
hello-compute refactor: satisfy clippy::manual_slice_size_calculation 2023-07-25 17:05:28 -04:00
hello-triangle Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
hello-windows Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
mipmap Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
msaa-line Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
shadow Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
skybox Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
stencil-triangles Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
texture-arrays Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
water Add support for occlusion queries (#3402) 2023-08-02 19:05:59 +00:00
README.md Formatting and example command fixes (#3872) 2023-06-15 20:05:26 +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 --bin <example-name>