800: Schedule event waits after redraw events are cleared r=kvark a=kvark
As @adamnemecek pointed out, our examples were busy waiting.
I investigated a bit and figured that our `WaitScheduled` was always interrupted by `RedrawEventsCleared`. So scheduling the wait in it works. Tested on Linux and macOS. CPU time of the cube example drops from 100% to single-digit.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
799: Update naga to gfx-16 r=kvark a=kvark
Makes WGSL constants much more ergonomic to write, and fixes the issues we had with the water example.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
797: Move from `tracing` to `log` + `profiling` r=kvark a=cwfitzgerald
Continuation of https://github.com/gfx-rs/wgpu/pull/1268 into wgpu-rs
This also includes the naga gfx-15 train.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
790: Update to naga-14 r=kvark a=kvark
Depends on https://github.com/gfx-rs/wgpu/pull/1262
Makes our shaders nicer, and the uniformity analysis less cranky :)
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
781: Mark BufferMappedRange Send/Sync on native r=kvark a=cwfitzgerald
This fixes an issue reported on the matrix where this was causing things to unnecessarily be !Send. There's no reason I can see that this couldn't be Send/Sync as we only use it like one would a slice. We might also consider backporting this to 0.7.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
778: Return None from get_swap_chain_preferred_format if the adapter does not support the surface r=kvark a=OlegOAndreev
Fixes#777
Almost every other method in wgpu panics on failure, so I decided to make the return value an `Option<TextureFormat>`, not a `Result<Option<TextureFormat>>`
Co-authored-by: Oleg Andreev <ooandreev@yandex-team.ru>
776: Update wgpu with the new vertex format r=kvark a=kvark
Based on https://github.com/gfx-rs/wgpu/pull/1235
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
773: Panic on empty buffer slices r=kvark a=Wumpf
Fixes#735
Can't really pass through zero sizes, so panic it is.
I'm really just here to update to latest wgpu version to get my recent fix there in a more convenient manner, but doing a PR with just that felt a bit boring ;-). Now I'm of course guilty of conflating things 🤔
Co-authored-by: Andreas Reich <r_andreas2@web.de>
765: Update naga to gfx-11 r=cwfitzgerald a=kvark
Gets us https://github.com/gfx-rs/wgpu/pull/1220
Note that "cross" feature is not optional here. We could lift it up and add to `default = []` but that would make the Web backend to always unconditionally depend on `wgpu-core` (since enabling a feature on it automatically enables it). So we ideally need a way for Cargo to allow platform-specific default features...
About the shadow example - the experimental translation works on the main pipeline, but fails on the baking pipeline because of https://github.com/gfx-rs/naga/issues/483. Fortunately, it falls back to SPIRV-Cross gracefully here.
The new validation detected a flaw in our shader (comparison sampler mismatch), yay!
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
744: Demonstrate obj loading in the skybox example r=kvark a=kvark
I wanted to see which example is best suited for `typed-arena` demo... and here I am, implementing a completely different unrelated feature. But I think it's useful, still ;)
Model loading is something everybody needs, and for us depending on `obj` in dev-dependencies cost nothing, especially since I'm basically maintaining it.
<img width="395" alt="screenshot" src="https://user-images.githubusercontent.com/107301/106993149-186c7780-6748-11eb-94ca-7988ef9ee52d.png">
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
759: Correct FragmentState targets comment r=grovesNL a=Systemcluster
Previously the comment was copied verbatim from the `VertexState` `buffers` field.
Co-authored-by: Chris <me@systemcluster.me>
755: Add Instance::poll_all r=kvark a=lachlansneff
`Instance::poll_all` polls all devices. This will be useful for integrating into the winit event loop from a third-party crate.
Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>