Files
wgpu/examples/README.md
T
Dzmitry Malyshau 74eed253d8 Convert cube, skybox, msaa-line, and mipmap, to WGSL
Validate example shaders in tests

Support WGSL on the Web via Naga

Port the shadow WGSL partially

Convert hello-compute and boids to WGSL

Conver the shadow's fragment shader to WGSL

Shader entry point refactor
2021-01-30 01:02:04 -05:00

3.8 KiB

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 framework-based examples render to the window.

Feature matrix

Feature boids cube mipmap msaa-line shadow skybox texture-arrays water
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 ⭐
optional extensions ⭐
- binding indexing ⭐
- push constants ⭐
- depth clamping ⭐
- compressed textures ⭐
- polygon mode ⭐
- queries ⭐
WGSL shaders ⭐ ⭐ ⭐ ⭐ ⭐ ⭐

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>