Disable vsync
Revert accidential hardcode of num_frames
Make the PresentMode configurable
Adapt examples
+ adjust style according to @kvrak
Adher to @kvarks wishes for style.
Examples build.
Fix unnecessary ampersand.
With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all
of the gfx-hal types that wgpu depends on implement Debug. Thus, some
types that could not derive Debug in #216 can now derive Debug.
This patch also adds Debug implementations for a few types that were
recently added to wgpu.
Fixes#76.
226: Tracking Rewrite r=grovesNL a=kvark
Fixes#44
The idea is to support independent tracking of sub-resources. Today, this is needed for textures, which can have individual layers and mipmap levels in different states at a time. Tomorrow, this will be needed for buffer sub-ranges.
The intent to hack it in grew into a complete rewrite of the tracker... The new approach is cleaner in a few places (e.g. `TrackPermit` is gone), but the implementation is obviously more complex. I tried to separate the levels from each other (see `ResourceState` and `RangedStates`) to fight complexity, but it requires a whole lot of testing infrastructure to be solid.
Also regresses #216 a bit, cc @arashikou : tracker is a relatively complex structure. I somehow doubt it's useful to look at it in debug spew. We may need to implement `Debug` manually for it before re-adding `Debug` derives on passes and command buffers.
TODO:
- [x] documentation of tracking types
- [x] unit tests for tracking logic
- [x] actual testing with existing apps, ensure no regressions
- [x] write a mipmap generation example
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
220: Free descriptor sets r=kvark a=rukai
Tested on https://github.com/rukai/brawllib_rs, wgpu examples and wgpu-rs examples.
Closes: https://github.com/gfx-rs/wgpu/issues/217
My approach was to just implement descriptor set tracking the same way textures and buffers are implemented.
Co-authored-by: Rukai <rubickent@gmail.com>
This adds #[derive(Debug)] to all public structs and enums possible.
This also required adding it to some private types that they
transitively depend on. However, the following types depend on types
from external crates that do not implement Debug:
* device::Device
* hub::Hub
* swap_chain::Surface
* swap_chain::SwapChain
To support these types, we would need to use either custom Debug impls
or something like Derivative.
This helps improve the situation in #76.
212: More consistent descriptor passing r=kvark a=porky11
also use pointer for descriptor in `wgpu_command_encoder_begin_render_pass` for consistency reasons
Co-authored-by: Fabio Krapohl <fabio.u.krapohl@fau.de>