Files
wgpu/examples
bors[bot]andBrian fb0f231045 Merge #400
400: Added test for "capture" example r=kvark a=bfrazho

I've added a test to validate the capture example. I was planning on using the existing "screenshot.png" that was in there for the assertion for the test, but apparently was slightly different from the one that I was generating. I ended up replacing the screenshot.png with what the test was generating.

I'm a little concerned that they were different from the start, but maybe the png generating library made some small changes over time. I did check to make sure that it generated the same png on Windows and Linux on the same computer.

Let me know if there is anything that you would like me to change!

Co-authored-by: Brian <brian@linux-ccip.lan>
2020-06-24 14:46:52 +00:00
..
2020-06-24 14:46:52 +00:00
2020-06-22 23:14:29 -04:00
2020-06-22 23:14:29 -04:00
2020-06-22 23:14:29 -04:00

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 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>