mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
408: Staging belt r=kyren a=kvark Implementing the belt itself isn't too hard, but integrating it with the example framework and winit's event loop is somewhat challenging. Perhaps, there needs to be a `LocalSpawner` parameter to `render()` like I did [in vange-rs](https://github.com/kvark/vange-rs/blob/e7bc944ef5a5a47d04cedd1c4d299295a1693fd3/bin/boilerplate.rs#L26)? Edit: code is all ready and shiny... but it does NOT work. Buffers don't come back from mapping for some reason. Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com> Co-authored-by: kyren <kerriganw@gmail.com>
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 show 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 | ⭐ | |||||||
| 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 | ⭐ | |||||||
| 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>