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>
* always plural form without _ptr suffix for pointers
* always same name as pointer for size, but with _length suffix
* special case: single size applies to multiple pointers => only use length as name
159: Add GPU timeout, fix active submission processing order r=kvark a=kvark
Fixes#156
The timeouts are going to be configurable later down the road.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
151: Assert on swapchain output usage before presenting r=grovesNL a=kvark
Fixes#148
There is no "fix" for the case on our side. The PR brings stronger requirements on the swapchain outputs: they have to be used and submitted before dropped.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
127: Track async mapping properly r=grovesNL,swiftcoder a=kvark
Fixes#117, fixes#95, fixes#132
The change can be logically split into 3 parts:
1. when `ActiveSubmission` is retired, we now move the mapped buffers into the "ready to map" vector. This was the missing bit that caused mapping to not work previously.
2. mapping callbacks in Rust wrapper are refactored and they `unmap()` automatically now on users behalf
3. we wait for idle before destroying the device, which allows us to process all the pending callbacks. This fix gets rid of the dummy submission our compute example used to do.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
112: Correctness fixes from 0.2, plus a lot of goodies r=kvark a=kvark
These are changes from #110 back-ported to master.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
96: Add the static lifetime bound to async buffer mapping callbacks r=kvark a=aloucks
These callbacks are executed outside of the mapping function and could previously reference data that had been dropped. Related #95.
Co-authored-by: Aaron Loucks <aloucks@cofront.net>
This allows async buffer mapping to function when a renderpass
is also submitted on the queue. The state transition and fencing
still needs work, however.
84: Create buffer mapped r=kvark a=swiftcoder
I haven't really taken a swing at error handling here, posting it up early for feedback on the API.
85: Unpin nightly date for bindings generation r=kvark a=grovesNL
rust-lang/rust#57915 allows us to run bindings generation with nightly again, so we shouldn't have to pin to an older nightly date anymore (assuming everyone has a recent nightly).
Co-authored-by: Tristam MacDonald <tristam@trist.am>
Co-authored-by: Joshua Groves <josh@joshgroves.com>