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.
262: Reverse srgb in hello-triangle r=kvark a=grovesNL
Reverse srgb support in hello-triangle (these were backwards by mistake)
Co-authored-by: Joshua Groves <josh@joshgroves.com>
`File::create` isn't available on wasm, so we can't actually write the
output image anywhere unless we target something else as the file
system (e.g. local storage)
Remove odd patching matching
Replace std::sync::Mutex with spin::Mutex in GpuFuture
Reduce GpuFuture usage to one explicit allocation instead of two
Fix examples to poll the device in the background when using map_read or map_write
Remove device.poll from GpuFuture::poll and document future invariants
Massively simplify examples
Use Arc::clone(...) instead of arc.clone()
Switch println to log::info
210: Update WGPU deps to rev 08e8d406c1 r=kvark a=aloucks
I also moved the `path` chunks in `Cargo.toml` to a single `[patch]` section so that it's one block to commment/uncomment for local development.
Co-authored-by: Aaron Loucks <aloucks@cofront.net>
157: Handle resizing in hello-triangle r=kvark a=quadrupleslap
Nothing gets drawn on my computer unless the swap chain is resized along with the window.
```
$ uname -a
Linux red 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64 GNU/Linux
$ wmctrl -m
Name: bspwm
Class: wm
PID: 665
Window manager's "showing the desktop" mode: N/A
```
Co-authored-by: Ram Kaniyur <quadrupleslap@gmail.com>
- `RedrawRequested` is now used for rendering
- `EventsCleared` replaced by `MainEventsCleared` which requests redraw
- Removed capture from hello-triangle to simplify it slightly
148: Change Queue::submit to take &self r=kvark a=LaylConway
This small change allows multiple threads to submit buffers slightly more efficiently, by being able to do it concurrently without a lock on Queue.
In practice currently `Queue::submit` does a lot of locking internally for most of the function's duration, so it's only a small performance win right now, but it opens up the road for more improvements.
Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
Updates for boids example
Rename example folder
Use chunks_muts when creating initial_particles data
No need for depth
Syntax and minor changes
calculate multiple particles in single compute unit
updates boids example to use framework impl
removed code
fix gpu invocations constants