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>
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
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
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`.
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).
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>