Commit Graph

87 Commits

Author SHA1 Message Date
Chinedu Francis Nwafili
309cc1cedd Add screenshots of examples
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.
2020-04-26 18:59:48 -02:30
Dzmitry Malyshau
b612d9c8ef Fix hello-triangle example format and bind group 2020-04-21 19:08:42 -04:00
bors[bot]
1e3b1a38fe Merge #262
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>
2020-04-20 02:18:30 +00:00
Joshua Groves
6de7f82666 Use opaque texels in mipmap example 2020-04-19 23:38:58 -02:30
Joshua Groves
a75100209e Reverse srgb support in hello-triangle 2020-04-19 16:32:50 -02:30
Joshua Groves
423f576d8e Use srgb for swapchain when possible 2020-04-18 01:04:28 -02:30
Joshua Groves
f0ab842d6e Combine wasm_main/main and add console_log 2020-04-18 01:04:28 -02:30
Joshua Groves
349f992a7a Switch event loop back to ControlFlow::Poll 2020-04-18 01:04:28 -02:30
Joshua Groves
95c69a192c Allow describe example to run on the web 2020-04-18 01:04:28 -02:30
Joshua Groves
8ee80efe59 Get shadow mostly working
Some of the implementation is still missing in Canary
2020-04-18 01:04:28 -02:30
Joshua Groves
b34c0af749 Only expose adapter info on native 2020-04-18 01:04:28 -02:30
Joshua Groves
a6473b52b9 Get capture mostly working
`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)
2020-04-18 01:04:28 -02:30
Joshua Groves
76d5855fdc Get mipmap mostly working
Subresource tracking for mip levels isn't available in Canary yet, so
we can't verify that the web example output matches native
2020-04-18 01:04:28 -02:30
Joshua Groves
2829bd3f00 Get skybox working 2020-04-18 01:04:28 -02:30
Joshua Groves
7a6fab83c4 Get cube working 2020-04-18 01:04:28 -02:30
Joshua Groves
2ea9e01e5c Get boids working 2020-04-18 01:04:28 -02:30
Joshua Groves
e1eaa6ca26 Add web backend 2020-04-18 01:04:28 -02:30
StarToaster
40a19ebe66 Removed zerocopy and replaced it with bytemuck. 2020-04-17 10:07:24 -04:00
Dzmitry Malyshau
1678a267cb Update wgpu for texture descriptor changes 2020-04-14 01:13:47 -04:00
Hackpoetic
a6e81dc703 cargo fmt the code and tweak format rules 2020-04-10 22:56:24 -04:00
Dzmitry Malyshau
b93e942b58 Update to latest wgpu, duplicate RequestAdapterOptions 2020-04-02 00:29:24 -04:00
Dzmitry Malyshau
02f7ac9c02 Change NDC Y axis 2020-03-30 09:36:36 -04:00
Joshua Groves
31e80d99b3 Update to latest wgpu 2020-03-30 07:58:06 -04:00
Joshua Groves
b917a60abd Avoid array indexing in hello-triangle 2020-03-30 07:58:06 -04:00
Lucas Kent
d08f837624 Move multithreaded_compute.rs into hello-compute tests (#223)
Setup hello-compute tests to run during `cargo test`
2020-03-29 19:55:39 -04:00
aloucks
d91b78bdfb Add VertexStateDescriptor (#221)
The vertex state properties are now bundled in the VertexStateDescriptor
which matches the spec.

Fixes #220
2020-03-28 10:45:18 -04:00
Lachlan Sneff
ea6bcd03e2 Rewrite GpuFuture to avoid blocking and to use less space
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
2020-03-27 00:16:35 -04:00
bors[bot]
7b15e24eae Merge #210
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>
2020-03-23 01:03:33 +00:00
Rukai
111f6c4f75 Improve BufferCopyView documentation 2020-03-22 23:24:43 +11:00
Aaron Loucks
277505e9c9 Update WGPU deps to rev 08e8d406c1 2020-03-20 21:48:25 -04:00
Joshua Groves
b3e4253df1 Return futures from request adapter/request device 2020-03-16 16:35:51 -02:30
Dzmitry Malyshau
d842432d17 Update for the latest spec changes 2020-03-15 11:25:06 -04:00
Aaron Loucks
d93293f58e Explicitly declare vertex attribute descriptors in cube example 2020-03-07 23:37:32 -05:00
Brian Frazho
3899fdb214 added test to hello-compute example 2020-02-28 20:50:28 -05:00
Diggory Hardy
dca51ce676 Add vertex_attr_array macro 2020-02-20 09:32:38 +00:00
Dzmitry Malyshau
b588345568 Disable no_redirection_bitmap on Windows 2020-02-09 19:25:34 -05:00
Dzmitry Malyshau
3a9113c962 Disable window bitmap redirection 2020-02-02 00:21:51 -05:00
Dzmitry Malyshau
37094051b5 Update wgpu and winit 2020-01-13 13:20:13 -05:00
bors[bot]
f9026595c0 Merge #157
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>
2020-01-12 20:04:25 +00:00
Ram Kaniyur
d75a1c5588 Accept DOS line endings in examples/boids 2020-01-11 12:55:51 +11:00
Ram Kaniyur
68b94ab3a3 Handle resizing in hello-triangle 2020-01-11 11:53:31 +11:00
Joshua Groves
a216c2bfca Update to latest winit (0.20.0-alpha6)
- `RedrawRequested` is now used for rendering
- `EventsCleared` replaced by `MainEventsCleared` which requests redraw
- Removed capture from hello-triangle to simplify it slightly
2020-01-04 18:33:33 -03:30
Dzmitry Malyshau
8f083e54c5 Update to latest wgpu c293d6dcea 2020-01-02 01:21:08 -05:00
bors[bot]
1529a88fd9 Merge #148
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>
2019-12-31 16:32:52 +00:00
Layl
45426eef9c Change Queue::submit to take &self 2019-12-31 16:24:49 +01:00
Mason
76076d31cf Adds compute-boids example from gpuweb demos
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
2019-12-29 12:17:14 -08:00
Tristam MacDonald
cc32408fa2 prototype of async/await for buffer mapping 2019-11-21 21:42:22 -08:00
Jacob Greenfield
68c81df381 Update examples and tests 2019-11-21 20:35:16 -05:00
Jacob Greenfield
88e8269182 cargo fmt 2019-11-21 00:20:28 -05:00
Dzmitry Malyshau
3609e52bfd Fix generic bounds on buffer mapping 2019-11-20 21:25:46 -05:00