Commit Graph
55 Commits
Author SHA1 Message Date
Connor Fitzgerald a67047297c Implement PUSH_CONSTANTS feature 2020-07-13 15:43:46 -04:00
Gabriel Majeri e01e93a619 Use common types from wgpu-types 2020-07-13 20:12:27 +03:00
Gabriel Majeri 009d062482 Unwrap errors from transfer API 2020-07-13 14:13:23 +03:00
Gabriel Majeri eb91482d0b Update to new wgpu-core render pipeline API 2020-07-07 21:02:11 +03:00
Connor Fitzgerald 5529b60da4 Convert Extensions + Capabilities into Features 2020-06-26 01:27:57 -04:00
Connor Fitzgerald 741644d252 Add Tracing 2020-06-22 23:14:29 -04:00
Dzmitry Malyshau 330986bc66 Update wgpu without peek-poke 2020-06-20 17:20:20 -04:00
Marvin Löbel 693abce446 Move backends: BackendBit paramter to Instance::new() 2020-06-19 01:25:38 +02:00
Dzmitry Malyshau 65718c1e25 Add include_spirv macro 2020-06-18 01:04:42 -04:00
Dzmitry Malyshau 3f0e11fe47 Remove interface blocks from the water shaders 2020-06-17 11:03:02 -04:00
Dzmitry Malyshau 47cbde6782 Update with minBufferBindingSize 2020-06-17 00:13:47 -04:00
Rukai 364034bb52 add test case for empty buffer 2020-06-15 12:18:58 +10:00
bors[bot]andConnor Fitzgerald 7b887f12a3 Merge #360
360: Implement TEXTURE_BINDING_ARRAY extension r=kvark a=cwfitzgerald

This extends https://github.com/gfx-rs/wgpu/pull/711 into wgpu-rs.

Notable changes: 
- Added an example showing off both this extension and the future descriptor indexing extension.
- Changed the framework so there is a static function showing what extensions you need. This is provided by the trait,, which defaults to no extensions, so existing examples and new ones don't have to care about extensions.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-11 20:37:46 +00:00
Connor Fitzgerald f8be38cc01 Implement TEXTURE_BINDING_ARRAY extension 2020-06-11 16:36:53 -04:00
Lachlan Sneff d9ecab0cdc Fix buffer mapping examples 2020-06-11 12:07:47 -04:00
bors[bot]andLachlan Sneff b1f3fbaab0 Merge #356
356: Add generic ranges to buffer mapping api and make it safe. r=kvark a=lachlansneff

[Rendered](https://charted.space/notes/wgpu-rs/wgpu/struct.Buffer.html)

The safety issues with the current api (being able to unmap while still holding a slice to mapped data) are fixed by having `get_mapped_range` and `get_mapped_range_mut` return `BufferView` and `BufferViewMut`, which notify the buffer that those ranges are no longer being used when they're dropped. `Buffer.unmap` asserts that the list of mapped ranges is empty, therefore it is safe.

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2020-06-10 17:46:36 +00:00
Lachlan Sneff 35dd34b4ec Add BufferView and BufferViewMut and fix safety issues with mapped range. 2020-06-09 20:03:28 -04:00
Dzmitry Malyshau 9259d2e51d Update to wgpu with shader validation 2020-06-08 20:54:39 -04:00
Connor Fitzgerald b71c420f7a Implement extensions interface as described in wgpu#691 2020-06-08 01:20:00 -04:00
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
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
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
Joshua Groves f0ab842d6e Combine wasm_main/main and add console_log 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
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
Joshua Groves 31e80d99b3 Update to latest wgpu 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
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
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
Brian Frazho 3899fdb214 added test to hello-compute example 2020-02-28 20:50:28 -05:00
Layl 45426eef9c Change Queue::submit to take &self 2019-12-31 16:24:49 +01: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
Cormac O'Brien 05e697831a Use count rather than size in map_read/write_async
Fixes #124
2019-11-20 04:29:09 -06:00
Dzmitry Malyshau b40bb71679 Wholesome update for the git master of wgpu-native 2019-11-19 20:58:32 -05:00
Dzmitry Malyshau 00c6d97dce Return Queue separately 2019-09-10 09:26:18 -04:00
Dzmitry Malyshau c6522fa60b Update wgpu-native to the commit that has no backend features.
This change removes the dependency on gfx-rs backends, refactors
Adapter and Surface creation to be done from nothing.
2019-08-29 22:04:43 -04:00
Dzmitry Malyshau c2743c279e Wholesome update for wgpu-0.3 2019-08-21 23:51:09 -04:00
Rukai 88965efbbf remove usages of wgn in examples 2019-08-18 13:36:48 +10:00
Rukai 69a894e91a Update to latest wgpu-native commit 2019-08-18 12:19:49 +10:00