1609: [Vulkan] Initialize wgpu objects from raw handles r=kvark a=zarik5
**Connections**
This PR is a successor of https://github.com/gfx-rs/gfx/pull/3762
**Description**
The `handle_is_external` flag mechanism was not enough to ensure safety, when for example the Instance is wrapped in `Arc<>` and a library cannot keep track of all its clones. This is the case with the bevy render rewrite. The solution was to let wgpu be in charge of destroying the handles, but it also has to keep a reference to a "drop guard" which is always dropped after the handle is destroyed. For the OpenXR integration, this drop guard will be `xr::Instance`.
For now this is just a proof of concept. Only instance creation is handled, and there is even type error in `wgc::Instance::from_hal()`.
I have a few concerns:
* Is it ok to expose `hal::Instance` from the wgpu crate? Or should the user pass all the parameters so `hal::Instance` can be constructed internally? This second options is more disruptive, since the wgpu-types crate would need to import all platform-specific crates to define the structure/enum to hold the raw handles.
* Without counting the call to create the `hal::Instance`, there are 4 indirection calls to save the raw instance. Can this be optimized in any way?
Do you think it is possible to merge wgpu-hal into wgpu-core? This could help with reducing the distance from the surface level API to the platform specific APIs even more.
**Testing**
Vulkan/Android (Oculus Quest) using [this sample](https://github.com/zarik5/openxrs/blob/wgpu-test/openxr/examples/vulkan.rs).
Co-authored-by: Riccardo Zaglia <riccardo.zaglia5@gmail.com>
1704: Fix buffer memory initialization to use the tracker consistently r=kvark a=kvark
**Connections**
Depends on https://github.com/gfx-rs/naga/pull/1125
**Description**
Contains a number of dx12 fixes in addition to the buffer initialization fix.
The problem there was - we used the "pending writes" command buffer to initialize buffers, but also used the device's resource tracker and its state to figure out the transitions *after* a command buffer is merged its states.
**Testing**
Ran the examples on Vulkan.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1602: New DX12 backend (unfinished) r=kvark a=kvark
**Connections**
Continuation of #1471
**Description**
Mostly fresh implementation on DX12 backend for wgpu-hal
Core changes:
- texture usage is filtered before passing to `create_texture_view`, so that wgpu-hal can assume every bit is important.
- all the copies involving textures are limited to one array layer at a time
- remove render pass boundary usages
**Testing**
Examples (not running yet)
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1607: Fix Downlevel Vertex Stage Storage Buffer Check r=kvark a=cwfitzgerald
**Connections**
Fixes a bug in #1599. Also follows up on #1583 marking all of hello-compute as a failure.
**Testing**
Tests now pass on rpi4.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1599: Fix Limits for lava/llvmpipe and re-enable and re-work CI r=kvark,groves,wumpf a=cwfitzgerald
**Connections**
No longer fixes#1551.
**Description**
This PR has a couple things going on at once.
- Fixes limits for llvmpipe, lavapipe, and rpi4.
- Added a downlevel limit to express that RPI4 does not allow storage buffers in vertex shaders on GL.
- Added a `Limits::downlevel_default()` that takes minimum limits from GLES and adds some more documentation on how to choose limits.
- Moved all examples to the new downlevel limits
- Reworks CI to re-enable software testing and unify instructions.
**Testing**
It is
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1592: Detailed limits check and error r=cwfitzgerald a=kvark
**Connections**
Related to #1590
**Description**
The old comparison "A < B" was simply wrong, because it would do every field in order and could bail out mid-way without reaching for all limits.
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>