Commit Graph

489 Commits

Author SHA1 Message Date
Lachlan Sneff
5c209e8cfd [rs] Add Instance::poll_all 2021-02-10 02:15:18 -05:00
bors[bot]
f719dc0752 [rs] Merge #754
754: Update naga to gfx-10 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1205

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-09 15:22:59 +00:00
Dzmitry Malyshau
8ff65dce8d [rs] Update naga to gfx-10 2021-02-09 10:21:56 -05:00
Tnze
e9d68a332d [rs] Use the "max" function to ensure that the swapchain size is not less than 1. For better readability. 2021-02-09 14:20:22 +08:00
Imbris
5a9801d86c [rs] Expose missing constants from wgpu-types 2021-02-07 15:08:17 -05:00
bors[bot]
36fde2821b [rs] Merge #710
710: Implement read_buffer r=kvark a=fintelia

I'm not sure about the exact interface that makes sense, but this PR sketches out how read_buffer (and eventually also read_texture) could be implemented. 

Resolves #694

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
2021-02-06 20:53:26 +00:00
Jonathan Behrens
7a02bfca78 [rs] Implement read_buffer utility function 2021-02-06 11:22:37 -05:00
Imbris
b1e535d2b7 [rs] Bump wgpu-core 2021-02-05 22:02:48 -05:00
Dzmitry Malyshau
f9eb133370 [rs] Experimental ReadBuffer structure 2021-02-05 12:59:49 -05:00
Dzmitry Malyshau
9755a464ae [rs] Update version and dependencies to gfx-9 2021-02-01 02:16:31 -05:00
Dzmitry Malyshau
41a1c0e46f [rs] Convert cube, skybox, msaa-line, and mipmap, to WGSL
Validate example shaders in tests

Support WGSL on the Web via Naga

Port the shadow WGSL partially

Convert hello-compute and boids to WGSL

Conver the shadow's fragment shader to WGSL

Shader entry point refactor
2021-01-30 01:02:04 -05:00
Dzmitry Malyshau
edb342cffe [rs] Update wgpu to the new render pipeline descriptor API 2021-01-29 00:51:44 -05:00
Dzmitry Malyshau
8f6804caa1 [rs] Fix the web backend in code and CI 2021-01-26 20:58:13 -05:00
bors[bot]
2f3d6bce6f [rs] Merge #717
717: Fixup WebGL Building Docs r=kvark a=cwfitzgerald

Improved the docs for building wgpu for targeting webgl. This would have prevented https://github.com/gfx-rs/gfx/issues/3594.

I also think (but haven't changed yet) that all the examples should use `wgpu::BackendBit::all()` as that is really what people should be defaulting to.

(Rendered: https://github.com/cwfitzgerald/wgpu-rs/blob/webgl-docs/README.md#run-examples-on-the-web-wasm32-unknown-unknown)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-01-23 23:53:30 +00:00
Connor Fitzgerald
316bd4f959 [rs] Fixup webgl docs 2021-01-23 18:20:41 -05:00
Matt Keeter
3ca0b0cf9c [rs] Bump wgpu-core and update texture_view_drop call 2021-01-23 12:12:42 -05:00
Dzmitry Malyshau
ea16651793 [rs] Remove typed-arena dependency 2021-01-19 22:01:54 -05:00
Connor Fitzgerald
eb2d591d59 [rs] Update wgpu-core etc 2021-01-16 02:58:07 -05:00
Connor Fitzgerald
af61d9c917 [rs] Add pipeline statistics and timeline queries 2021-01-16 01:05:03 -05:00
Andreas Reich
1974b2a344 [rs] Exposed get_texture_format_features on adapter 2021-01-13 23:23:44 +01:00
Mikko Lehtonen
9ab5cdbd1f [rs] Format PassErrorScope pipelines 2021-01-12 23:32:10 +02:00
Niklas Korz
4d2bec6cab [rs] Move get_swap_chain_preferred_format from device to adapter
Squashed commit of the following:

commit 260976b10e3a54b253768d71e5e47c51b976c25c
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 20:23:31 2021 +0100

    Formatting

commit e3f837e1b6a81c8c7a9566ba6a2c6dd8adfbbde7
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 20:20:37 2021 +0100

    Update examples

commit b0774c0aa56fbdfe741dd6c0e86d55b8c6b42de3
Author: Niklas Korz <niklas@niklaskorz.de>
Date:   Mon Jan 11 19:31:29 2021 +0100

    Use adapter.get_swap_chain_preferred_format
2021-01-11 20:32:03 +01:00
Andrew Kilroy
08fd37b429 [rs] Fix compilation on aarch64-apple-darwin
wgpu-rs couldn't compile on the Apple M1 (arm64) macs due to a compilation
problem in winit.  winit 0.24.0 has the fix so upgrade the dependency.

Link to the fix's pull request in winit:
   https://github.com/rust-windowing/winit/pull/1752
2021-01-10 11:16:04 +00:00
TheArtist
f5dc0f91f7 [rs] Update to latest wgpu 2021-01-10 10:54:38 +02:00
Jay Oster
78f33bcf67 [rs] Replace futures with pollster
This PR removes all of the `futures` dependencies. `std::future` does not contain a lot of useful helpers available in futures. The obvious ones are `join_all`, `FutureExt::map`, and `block_on`.

* `join_all` is replaced with a `Vec<T>` and async blocks.
* `FuturesExt::map` in the web backend is replaced by rolling the `map` function into the `MakeSendFuture` type.
* `block_on` is provided by `pollster`.

The original code using `join_all` ignored the result type yielded by the Future from `map_async`. This code does the same, but makes dropping the result a little more obvious.

These should not be troublesome. Figured I would call them out anyway.

The last big change is replacing `futures-executor` in the examples with `async-executor`. A new concrete `Spawner` type is used in the example framework instead of an implementation of `futures_task::LocalSpawn`.
2021-01-07 10:10:18 -08:00
Manuel Gil
291668d124 [rs] Fix cargo doc warnings due to unresolved links 2021-01-06 18:30:24 +00:00
Andreas Reich
070bceda31 [rs] Fixed inconsistent framerate in examples.
Does not affect web builds.
Previously, framerate would float between 30-40 fps depending on how many events would come in. Fast mouse movements over the window lead to higher framerates since request_redraw was called every 20ms (-> 50fps) AND all events were consumed, additionally the event loop would wake up only every 10ms, so actual rate of request_redraw depended on how often we'd wake up.
Fixed this by setting the max sleep time of the event loop to the remaining time until hitting the desired time interval since the last frame.

The difference is most visible on the spinning cubes in the shadow example since the cubes currently spin with a fixed angle per frame (independent of frame timings).
2021-01-05 22:58:28 +01:00
Manuel Gil
d2844caaf0 [rs] Remove wgpu-subscriber -> subscriber alias in examples 2021-01-05 19:05:52 +00:00
Manuel Gil
81bcc72651 [rs] Expose get_swap_chain_preferred_format on Device
- Update examples to make use of the new method
2021-01-03 17:35:04 +00:00
0x182d4454fb211940
cbbf25c6f8 [rs] Add set_push_constants to RenderEncoder 2020-12-25 14:01:04 +00:00
0x182d4454fb211940
a2ff43f989 [rs] Remove unneeded cast from encoder.rs 2020-12-25 13:50:36 +00:00
0x182d4454fb211940
8dc1c0896b [rs] Move RenderEncoder to util 2020-12-25 13:47:38 +00:00
0x182d4454fb211940
6ee00ab401 [rs] Add RenderEncoder 2020-12-24 17:37:06 +00:00
bors[bot]
f1604cdc57 [rs] Merge #684
684: First step for WebGL support. r=grovesNL a=VincentFTS

This permits to test WebGL backend in Wgpu-rs.
Next step is to test examples to make them work with WebGL backend !

Co-authored-by: Vincent Jousse <contact@ftsoftware.fr>
2020-12-22 17:48:23 +00:00
Vincent Jousse
9f3a050fc4 [rs] First step for WebGL support. 2020-12-22 18:41:07 +01:00
Connor Fitzgerald
5fac4835f6 [rs] Use only 1 and 4 samples for msaa-line example 2020-12-21 15:34:19 -05:00
Dzmitry Malyshau
7a8c6cefe1 [rs] Expose adapter.get_info() everywhere 2020-12-18 21:18:07 -05:00
Dzmitry Malyshau
92c7cdbaba [rs] Move DeviceExt into a separate module 2020-12-17 17:55:11 -05:00
Dzmitry Malyshau
bafcc5ace5 [rs] Update wgpu with Naga fixes and OpenGL backend 2020-12-17 13:03:27 -05:00
Emanuele Dalla Longa
0b718aea93 [rs] Require labels to match gfx-rs/wgpu#1088
Change-Id: I1acc45a3023dfc78b6694bd4a28a0131f07b7ba7
2020-12-16 00:15:05 +01:00
Zsolt Bölöny
acf94e9321 [rs] Update to latest wgpu master 2020-12-14 17:57:27 +01:00
Connor Fitzgerald
7e05bba6c4 [rs] Add create_texture_with_data helper 2020-12-12 01:50:49 -05:00
Mikko Lehtonen
88a6d957c7 [rs] Add label to create_shader_module 2020-12-08 22:56:17 +02:00
Dzmitry Malyshau
95dcacd1ad [rs] Update wgpu with Naga changes, replace hello-triangle shaders with WGSL 2020-12-07 09:45:24 -05:00
Connor Fitzgerald
20689c32d2 [rs] Integrate ETC and ASTC textures in skybox example 2020-12-06 16:51:57 -05:00
Dzmitry Malyshau
47f471bebb [rs] Introduce ShaderModuleDescriptor 2020-12-05 18:53:37 -05:00
kejor
fe1a76dee7 [rs] API and examples update for index_format 2020-12-04 20:29:42 -05:00
Dzmitry Malyshau
41c658df7a [rs] Fix map_extent_3d in the Web backend 2020-12-02 17:32:36 -05:00
Joshua Groves
1431e7f9d1 [rs] Temporarily skip debug labels for web backend
Debug labels aren't currently supported by gecko
2020-12-02 00:32:55 -03:30
Dzmitry Malyshau
265c99c1d7 [rs] Create CHANGELOG.md 2020-12-01 09:25:15 -05:00