90: Basic render pipeline compatibility check r=grovesNL a=kvark
A bit of refactoring for nicer code, and now we are matching the attachment formats of pipelines bound to passes.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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>
80: Typed mapping of buffers r=kvark a=swiftcoder
Add a sprinkling of generics to remove the need for unsafe code to typecast slices resulting from mapping buffers.
Co-authored-by: Tristam MacDonald <tristam@trist.am>
81: Buffer tracking and unmapping r=kvark a=swiftcoder
Adds preliminary transitioning of buffers to mapped state.
Adds buffer unmapping to the cube sample.
Modifies wgpu_queue_submit to not hold a write lock on the device during callbacks (this could definitely be cleaner, but I'm not sure which direction to take refactoring here).
Co-authored-by: Tristam MacDonald <tristam@trist.am>
Adds preliminary transitioning of buffers to mapped state.
Adds buffer unmapping to the cube sample.
Modifies wgpu_queue_submit to not hold a write lock on the device during callbacks.
59: Map buffers async r=kvark a=swiftcoder
This is not ready to merge. It works well enough for the example, but looking for some early feedback.
In particular:
- It's not really async, since gfx-hal's mapping APIs seem to all be immediate.
- Async callbacks in Rust are really unpleasant due to lifetimes, so maybe it's just as well they aren't async.
- There is no validation and no real error handling here yet.
Co-authored-by: Tristam MacDonald <swiftcoder@gmail.com>
71: Shadow example r=grovesNL a=kvark
~~I believe all the nuts and bolts are in place, just figuring out some details of making the shadow match between the rendering and sampling (hence the WIP).~~
Most importantly, this PR includes crucial fixes and improvements of our resource tracking, plus a few fixes in the bind group and texture creation code.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
69: Swapchain resize r=kvark a=kvark
Based on #67
Here are the steps (as outlined on Gitter) that this PR follows:
1. create a dummy frame in the swapchain (`SwapChain::outdated`). We return it when we aren't able to acquire a real frame. No synchronization is done atm, but shouldn't be anything critical there.
2. handle the errors on acquire and present, use the dummy frame where needed. Presentation errors are just ignored, while acquiring errors are forcing the dummy frame. The idea is that the user would know about a swapchain resize from some kind of event loop / WSI, and thus they'd know when they should actually re-create it.
3. associate surface with a swapchain. We merge the IDs since there can't be multiple swapchains on the same surface in the near future. Merging simplifies a lot of things in the implementation, but this is to be revised for sure once we get a better look on the browser integration.
4. when the swapchain is re-created, consume the old one associated with a surface.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>