726: Bump wgpu-core and update texture_view_drop call r=kvark a=mkeeter
This PR updates to the latest `wgpu-core` commit ([wgpu #1163](https://github.com/gfx-rs/wgpu/pull/1163)), and is the counterpart to [wgpu-native #66](https://github.com/gfx-rs/wgpu-native/pull/66).
I'm using `wait = false` in the `texture_view_drop` call to match `buffer_drop` and `texture_drop` elsewhere `backend/direct.rs`, though I don't quite understand the implications 😅
Co-authored-by: Matt Keeter <matt.j.keeter@gmail.com>
716: Update Wgpu-Core r=trivial a=cwfitzgerald
This rollup fixes a pretty bad segfault that always occurs.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
713: Expose texture format feature query (and update to latest wgpu) r=kvark a=Wumpf
Exposes texture format feature query from https://github.com/gfx-rs/wgpu/pull/1112
Updating wgpu-core led to breaking change of moving get_swap_chain_preferred_format from device to adapter.
Co-authored-by: Andreas Reich <r_andreas2@web.de>
698: Format PassErrorScope pipelines r=kvark a=scoopr
Pairing for gfx-rs/wgpu#1132, formats the pipeline ids
Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
709: Move get_swap_chain_preferred_format from device to adapter r=kvark a=niklaskorz
See https://github.com/gfx-rs/wgpu/pull/1142. This PR applies the necessary changes for the move of `get_swap_chain_preferred_format` from device to adapter.
Co-authored-by: Niklas Korz <niklas@niklaskorz.de>
707: Fix compilation on aarch64-apple-darwin r=kvark a=andykilroy
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
Co-authored-by: Andrew Kilroy <7545475+andykilroy@users.noreply.github.com>
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
685: Replace futures crate with pollster. r=grovesNL a=parasyte
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 an `async` block.
- `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`.
Fixes#628
Co-authored-by: Jay Oster <jay@kodewerx.org>
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`.
699: Fixed inconsistent framerate in examples. r=kvark a=Wumpf
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.
Co-authored-by: Andreas Reich <r_andreas2@web.de>
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).
697: Remove wgpu-subscriber -> subscriber alias in examples r=kvark a=manugildev
Fixes#686
> All examples should be able to be copied into their own project and missing crates filled in based on errors alone.
Co-authored-by: Manuel Gil <manugildev@gmail.com>
690: Add `RenderEncoder` r=kvark a=0x182d4454fb211940
It seems like `RenderPass` and `RenderBundleEncoder` share many methods in common (`set_pipeline`, `draw_indexed`, etc). By creating a shared trait, it allows more reusable code. For instance:
```rust
impl RedCircle {
fn new(...) -> Self { .. }
fn draw<'a>(&'a self, encoder: &mut impl RenderEncoder<'a>) { .. }
}
```
This code would then work for both structs.
Moving the previous methods from their `impl`s to the trait's would break previous code, as to use these methods code would now have to import `RenderEncoder`. To avoid this, it is implemented by calling the direct methods.
It may be worth considering moving this to `wgpu::util`.
Co-authored-by: 0x182d4454fb211940 <nathanwoodformal@gmail.com>
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>
688: Use only 1 and 4 samples for msaa-line example r=kvark a=cwfitzgerald
As 1 and 4 samples are the only universally supported values, switch the msaa-line example to only using them. In the future where users can determine the supported sample counts. See https://github.com/gfx-rs/wgpu/issues/804
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
680: Update wgpu with Naga fixes and OpenGL backend r=cwfitzgerald a=kvark
This PR makes it easier to build wgpu-rs on Linux, since it doesn't require pkg-config into EGL.
Fixes#607
Fixes https://github.com/gfx-rs/wgpu/issues/1063
Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
672: Add write_whole_texture_mips Helper r=kvark a=cwfitzgerald
Adds a helper in QueueExt for uploading an entire texture with all of its mips. Name very bikeshedable.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>