Commit Graph

101 Commits

Author SHA1 Message Date
Connor Fitzgerald
cf9d9d6656 Rustify the example's use of Extensions and SamplerDescriptor 2020-06-02 21:44:07 -04:00
Dzmitry Malyshau
63219a5a85 Use the new map-async 2020-06-02 14:23:34 -04:00
Dzmitry Malyshau
ac6f79cb72 Read-only depth-stencil support 2020-06-01 20:25:01 -04:00
Connor Fitzgerald
c4819ccf7d Add Extension/Limit interface 2020-06-01 13:08:56 -04:00
AlphaModder
91d46ecc2b Rename SwapChain::get_next_texture to SwapChain::get_next_frame, and have it return errors to the user. 2020-05-30 18:41:31 -07:00
Dzmitry Malyshau
686b4f71a6 Update wgpu and use write_texture 2020-05-26 10:10:32 -04:00
Dzmitry Malyshau
1e722a557e Read WGPU_TRACE environment in the examples 2020-05-15 17:49:16 -04:00
Dzmitry Malyshau
28c826182f Update wgpu and use write_buffer in the examples 2020-05-14 10:12:47 -04:00
Keeley Hoek
ab2f1c7d03 Don't busy-redraw in examples 2020-05-12 03:20:19 +10:00
Paul Kernfeld
1172a186b1 Add Buffer.slice fn for #199
This fn is used for set_index_buffer, set_vertex_buffer, and
BindingResource
2020-05-10 17:37:19 -04:00
Dzmitry Malyshau
17b46687ce Rustfmt pass on examples 2020-05-05 21:55:42 -04:00
Dzmitry Malyshau
4413c4648d Update for wgpu-core 2020-04-30 15:52:16 -04:00
Dzmitry Malyshau
e30a428190 Port the Web backend to the Context trait 2020-04-26 19:18:24 -04:00
Dzmitry Malyshau
ba95354734 Rewire the backend system to remove wgpu-native step
Main change here is the introduction of the Context trait.
The "direct" implementation of it goes straight to wgpu-core.

This commit also has small improvements:
- consuming command buffers on submit
- Instance type
- proper call to destructors
2020-04-26 19:18:24 -04:00
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