mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
When looking into wgpu-rs as a replacement for WebGL I went to the examples directory on GitHub to browse for a bit. I wanted to see some of the examples at a glance without needing to clone the repository. This commit enables that by adding a README to each example with a description of the example and screenshots / example output. In a few cases the description is a bit redundant - but my hope is that in the future we can improve all the READMEs. Being a web API and thus very accessible, WebGPU could end up being many people's first introduction to graphics programming so the lower we make the barrier the better.
hello-compute
Runs a compute shader to determine the number of iterations of the rules from Collatz Conjecture
- If n is even, n = n/2
- If n is odd, n = 3n+1
that it will take to finish and reach the number 1.
To Run
# Pass in any 4 numbers as arguments
RUST_LOG=hello_compute cargo run --example hello-compute 1 4 3 295
Example Output
[2020-04-25T11:15:33Z INFO hello_compute] Times: [0, 2, 7, 55]