Commit Graph
144 Commits
Author SHA1 Message Date
Lachlan Sneff 42a8c480a7 Split render pass docs into multiple sections, divided by feature 2020-07-09 11:06:09 -04:00
Gabriel Majeri eb91482d0b Update to new wgpu-core render pipeline API 2020-07-07 21:02:11 +03:00
Ben Frankel 17b6982f49 Allow trailing comma in vertex_attr_array! 2020-06-28 14:23:23 -07:00
Connor Fitzgerald cc5ff8e992 Implement MultiDrawIndirect Extensions 2020-06-28 01:39:17 -04:00
Gabriel Majeri 3720e96321 Improve crate docs 2020-06-27 21:25:19 +03:00
Connor Fitzgerald 5529b60da4 Convert Extensions + Capabilities into Features 2020-06-26 01:27:57 -04:00
Dzmitry Malyshau aef72d7fd7 Refactor examples API, improve belt documentation and logic 2020-06-23 23:51:47 -04:00
Dzmitry Malyshau 4aa7abdff8 Staging belt, use LocalSpawner for the framework 2020-06-23 23:15:47 -04:00
Connor Fitzgerald 741644d252 Add Tracing 2020-06-22 23:14:29 -04:00
Dzmitry Malyshau 3f57811e7a Another refactor of RenderPassDescriptor API 2020-06-20 19:07:06 -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
Nathan Kent 3984737743 Change SpirV macro from expr to tt
As suggested in the pull request.
2020-06-18 13:56:48 -04:00
Nathan Kent b0b577c9a3 Allow concat in SpirV macro
The `include_spirv` macros was set to accept literals only.
Unfortunately, this means that other macros, such as `concat` and `env`
aren't accepted, making it unusable with build script-compiled shaders.
This change allows those macros to be used to load the SpirV at the
expense of a potentially less helpful error message as the `literal`
requirement is differed to the `include_bytes` invocation.
2020-06-18 13:47:29 -04:00
Connor Fitzgerald ffde811da2 wgpu-rs documentation pass 2020-06-18 11:10:18 -04:00
Dzmitry Malyshau 65718c1e25 Add include_spirv macro 2020-06-18 01:04:42 -04:00
bors[bot]andNikita Krupitskas ddfe8d67d2 Merge #374
374: Add debug markers and debug markers example r=kvark a=krupitskas

Depends on https://github.com/gfx-rs/wgpu/pull/719

Co-authored-by: Nikita Krupitskas <krupitskas@icloud.com>
2020-06-17 13:54:00 +00:00
Dzmitry Malyshau 47cbde6782 Update with minBufferBindingSize 2020-06-17 00:13:47 -04:00
Nikita Krupitskas f9ae9be70a Add debug markers and debug markers example 2020-06-16 11:13:03 +03:00
Dzmitry Malyshau fe42169e2e Revert "API update for RODS2"
This reverts commit edb3610530.
2020-06-15 18:16:14 -04:00
Connor Fitzgerald 021419b15d Implement SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING 2020-06-15 15:09:06 -04:00
Dzmitry Malyshau edb3610530 API update for RODS2 2020-06-14 09:25:13 -04:00
Dzmitry Malyshau 71cfb32342 Render bundle support, use in msaa-line example 2020-06-11 22:59:40 -04: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
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
bors[bot]andConnor Fitzgerald 092d5bb6fd Merge #350
350: Implement Extensions Interface r=kvark a=cwfitzgerald

This implements https://github.com/gfx-rs/wgpu/pull/703 in wgpu-rs. Notable changes include the removal of the anisotropic field from the examples, in favor of the now mandatory `..Default::default()` syntax.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-08 05:21:23 +00:00
Connor Fitzgerald b71c420f7a Implement extensions interface as described in wgpu#691 2020-06-08 01:20:00 -04:00
kyren 42de0b2769 Properly honor mapped_at_creation in Device::create_buffer
The returned `Buffer` should immediately be mappable.  Fixes #351
2020-06-06 15:55:15 -04:00
Rukai f6123e4fe8 Add aribitrary texture size handling to the capture example 2020-06-06 14:56:08 +10: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
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
Marvin Löbel dd087b810e Add equality derives to BindGroupLayoutEntry 2020-05-29 22:55:21 +02:00
Dzmitry Malyshau 686b4f71a6 Update wgpu and use write_texture 2020-05-26 10:10:32 -04:00
Dzmitry Malyshau 28c826182f Update wgpu and use write_buffer in the examples 2020-05-14 10:12:47 -04: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
bors[bot]andkyren 9f19533462 Merge #272
272: Force the wasm32 types to match Send / Sync with the native types r=kvark a=kyren

This is potentially a controversial change so this is just a draft to discuss it.

Currently, when building wgpu on wasm32, none of the interface types are Send or Sync, whereas on any other platform they are generally Send and Sync and this can cause a lot of pain, especially in the presence of async.

This PR is the nuclear option: lie and forcibly declare nearly all interface types to be Send or Send + Sync.

I think I understand the situation with proposed wasm32 threading a bit better now, and as of right now at least with my current understanding, it seems to me unlikely that javascript values held by rust could *ever* be sent transparently to another worker.  The mechanism that rust apparently will use to implement transparent threading will be to use `SharedArrayBuffer` to share memory between multiple workers.  Javascript provides a way for certain (serializable) objects to be shared with with other workers through `worker.postMessage()`, so Javascript has *some* story for sending javascript values to other threads, but only plain rust values that exist solely in the `SharedArrayBuffer` memory are send-able under this scheme.  I've looked briefly through some of the wasm proposals like the interface types proposal, but I don't have a good sense if there's any proposed mechanism at all for interface types and threads to interact at all.

If that's true that's really unfortunate because it seems like any thread safe API shared by native and web is doomed to mismatch.  This is even more unfortunate because many of the webgpu types in the draft standard are marked as 'Serializable', meaning that they *are* actually safe to send to another worker via `postMessage`, but there does not appear to be a planned way for rust to do this transparently.

I definitely could be misunderstanding the situation though and even if I am understanding it, the situation may have since changed.  I also don't know the timing here, I don't know what the eventual timing of wasm32 threading support will be vs webgpu support and interface types support.  *Right now* this PR is almost certainly sound, but there's definitely a possible future where it becomes unsound, and even maybe a possible future where it becomes unsound but then could later be made sound again.

Co-authored-by: kyren <kerriganw@gmail.com>
2020-05-07 04:09:14 +00:00
kyren c37a3233e9 Force the wasm32 types to match Send / Sync with the native types
There are several things in this commit:

1) Add `Send` or `Send + Sync` bounds to most of the associated types in `Context`.
2) Force most of the handle types and future types returned by the web backend to be Send / Sync
3) Make `BufferReadMapping` and `BufferWriteMapping` `Send` again on native by
   making the associated detail types implement `Send`.
2020-05-06 23:02:27 -04:00
Dzmitry Malyshau 7147340595 Free pass contents 2020-05-05 21:55:25 -04:00
Dzmitry Malyshau f3ff8d33ae Update wgpu with the BGL fix 2020-05-05 00:04:24 -04:00
Dzmitry Malyshau 4413c4648d Update for wgpu-core 2020-04-30 15:52:16 -04:00
Dzmitry Malyshau b7883e485c Small comment on WebGPU backend bit, readme update 2020-04-27 00:11:22 -04:00
Dzmitry Malyshau e30a428190 Port the Web backend to the Context trait 2020-04-26 19:18:24 -04:00
Dzmitry Malyshau 0d85635008 Move everything into Context trait, remove async 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