Commit Graph
130 Commits
Author SHA1 Message Date
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
Aron Granberg 567cb16f7c Improve docs for BindingType 2020-04-22 15:07:11 +02:00
Joshua Groves 9952801e2f Add labels to mapped descriptors where possible 2020-04-18 01:04:28 -02:30
Joshua Groves d1197c0c2e Fix some remaining TODOs in the web backend 2020-04-18 01:04:28 -02:30
Joshua Groves 643481ed81 Expose more functions on the web backend 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 bf49c1a4f1 Update to latest winit and wasm-bindgen 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 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 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
bors[bot]andLachlan Sneff 1c1dc8c573 Merge #254
254: Specify expected structure for draw_indirect and draw_indexed_indirect r=kvark a=lachlansneff

~~Based on https://www.khronos.org/opengl/wiki/Vertex_Rendering#Indirect_rendering.~~ Turns out the opengl docs are wrong. Based on https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDrawIndirectCommand.html.

Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2020-04-12 16:14:15 +00:00