2020-06-18 16:41:38 +00:00
|
|
|
## Structure
|
|
|
|
|
|
|
|
For the simplest examples without using any helping code (see `framework.rs` here), check out:
|
2023-06-15 20:05:26 +00:00
|
|
|
|
|
|
|
- `hello` for printing adapter information
|
|
|
|
- `hello-triangle` for graphics and presentation
|
|
|
|
- `hello-compute` for pure computing
|
2020-06-18 16:41:38 +00:00
|
|
|
|
2020-07-09 20:07:53 +00:00
|
|
|
Notably, `capture` example shows rendering without a surface/window. It reads back the contents and saves them to a file.
|
2020-06-18 16:41:38 +00:00
|
|
|
|
2021-03-31 02:00:25 +00:00
|
|
|
All the examples use [WGSL](https://gpuweb.github.io/gpuweb/wgsl.html) shaders unless specified otherwise.
|
|
|
|
|
2021-06-22 01:13:38 +00:00
|
|
|
All framework-based examples render to the window and are reftested against the screenshot in the directory.
|
2020-06-18 16:41:38 +00:00
|
|
|
|
|
|
|
## Feature matrix
|
2023-06-15 20:05:26 +00:00
|
|
|
|
2023-01-02 12:47:10 +00:00
|
|
|
| Feature | boids | bunnymark | cube | mipmap | msaa-line | shadow | skybox | texture-arrays | water | conservative-raster | stencil-triangles |
|
2023-06-15 20:05:26 +00:00
|
|
|
| ---------------------------- | ------ | --------- | ------ | ------ | --------- | ------ | ------ | -------------- | ------ | ------------------- | ----------------- |
|
2023-01-02 12:47:10 +00:00
|
|
|
| vertex attributes | :star: | | :star: | | :star: | :star: | :star: | :star: | :star: | | |
|
|
|
|
| instancing | :star: | | | | | | | | | | |
|
|
|
|
| lines and points | | | | | :star: | | | | | :star: | |
|
|
|
|
| dynamic buffer offsets | | :star: | | | | :star: | | | | | |
|
|
|
|
| implicit layout | | | | :star: | | | | | | | |
|
|
|
|
| sampled color textures | :star: | :star: | :star: | :star: | | | :star: | :star: | :star: | :star: | |
|
|
|
|
| storage textures | :star: | | | | | | | | | | |
|
|
|
|
| comparison samplers | | | | | | :star: | | | | | |
|
|
|
|
| subresource views | | | | :star: | | :star: | | | | | |
|
|
|
|
| cubemaps | | | | | | | :star: | | | | |
|
|
|
|
| multisampling | | | | | :star: | | | | | | |
|
|
|
|
| off-screen rendering | | | | | | :star: | | | :star: | :star: | |
|
|
|
|
| stencil testing | | | | | | | | | | | :star: |
|
|
|
|
| depth testing | | | | | | :star: | :star: | | :star: | | |
|
|
|
|
| depth biasing | | | | | | :star: | | | | | |
|
|
|
|
| read-only depth | | | | | | | | | :star: | | |
|
|
|
|
| blending | | :star: | :star: | | | | | | :star: | | |
|
|
|
|
| render bundles | | | | | :star: | | | | :star: | | |
|
|
|
|
| compute passes | :star: | | | | | | | | | | |
|
|
|
|
| error scopes | | | :star: | | | | | | | | |
|
2023-06-15 20:05:26 +00:00
|
|
|
| _optional extensions_ | | | | | | | | :star: | | | |
|
2023-01-02 12:47:10 +00:00
|
|
|
| - SPIR-V shaders | | | | | | | | | | | |
|
|
|
|
| - binding array | | | | | | | | :star: | | | |
|
|
|
|
| - push constants | | | | | | | | | | | |
|
|
|
|
| - depth clamping | | | | | | :star: | | | | | |
|
|
|
|
| - compressed textures | | | | | | | :star: | | | | |
|
|
|
|
| - polygon mode | | | :star: | | | | | | | | |
|
|
|
|
| - queries | | | | :star: | | | | | | | |
|
|
|
|
| - conservative rasterization | | | | | | | | | | :star: | |
|
2023-06-15 20:05:26 +00:00
|
|
|
| _integrations_ | | | | | | | | | | | |
|
2023-01-02 12:47:10 +00:00
|
|
|
| - staging belt | | | | | | | :star: | | | | |
|
|
|
|
| - typed arena | | | | | | | | | | | |
|
|
|
|
| - obj loading | | | | | | | :star: | | | | |
|
2020-06-18 16:41:38 +00:00
|
|
|
|
|
|
|
## Hacking
|
|
|
|
|
|
|
|
You can record an API trace any of the framework-based examples by starting them as:
|
2023-06-15 20:05:26 +00:00
|
|
|
|
2020-06-18 16:41:38 +00:00
|
|
|
```sh
|
2023-06-15 20:05:26 +00:00
|
|
|
mkdir -p trace && WGPU_TRACE=trace cargo run --features trace --bin <example-name>
|
2020-06-18 16:41:38 +00:00
|
|
|
```
|