mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
* The conditional at the start of resize() already tests for and exits on the zero width and height condition. The conditional removed here was then getting run on every other call to resize(), which doesn't seem logical, doesn't correspond to the comment, and seemed to be causing at least one issue with rendered viewport going black during resize. Fixes #532 (probably) Fixes #519 * Defensive coding to prevent various issues when window size goes to zero, e.g. NaN being passed in cgmath::perspective() aspect ratio parameter. Fixes #531
Structure
For the simplest examples without using any helping code (see framework.rs here), check out:
hellofor printing adapter informationhello-trianglefor graphics and presentationhello-computefor 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 | ⭐ | |||||||
| - BCn compressed textures | ⭐ | |||||||
| 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>