mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
Squashed commit of the following: commit 260976b10e3a54b253768d71e5e47c51b976c25c Author: Niklas Korz <niklas@niklaskorz.de> Date: Mon Jan 11 20:23:31 2021 +0100 Formatting commit e3f837e1b6a81c8c7a9566ba6a2c6dd8adfbbde7 Author: Niklas Korz <niklas@niklaskorz.de> Date: Mon Jan 11 20:20:37 2021 +0100 Update examples commit b0774c0aa56fbdfe741dd6c0e86d55b8c6b42de3 Author: Niklas Korz <niklas@niklaskorz.de> Date: Mon Jan 11 19:31:29 2021 +0100 Use adapter.get_swap_chain_preferred_format
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 | ⭐ | |||||||
| - polygon mode | ⭐ | |||||||
| 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>