1732: Fix Tests on DX12/GL r=kvark a=cwfitzgerald
**Connections**
Marks #1730 as known failure
Closes#1695
**Description**
This fixes up tests on both DX12 and GL
**Testing**
Tests
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1731: hal/dx12: support base vertex/instance r=cwfitzgerald a=kvark
**Connections**
Fixes#1725
Depends on https://github.com/gfx-rs/naga/pull/1141, https://github.com/gfx-rs/d3d12-rs/pull/34, and https://github.com/gfx-rs/d3d12-rs/pull/35 (thanks `@msiglreith` for quick reviews!).
**Description**
We allocate one root parameter covering the special constant buffer view with root constants. We set the root constants for each draw, but only on change.
This PR does *not* handle the indirect case. I'll follow-up with this.
**Testing**
Not thoroughly tested, but `@cwfitzgerald` already implemented a test for this, and this PR enables it on DX12.
Also, examples still seem to work :)
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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>
1717: Work Around Fastclear Bug for Web and Native GL r=cwfitzgerald,kvark a=zicklag
**Connections**
Resolves#1627
**Description**
Works around Mesa fastclear bug by doing a manual shader clear on effected platforms
**Testing**
Tested on Mesa Intel(R) UHD Graphics (CML GT2) (Gl)
Co-authored-by: Zicklag <zicklag@katharostech.com>
I had to do a bit of digging to find information about coordinate systems in
wgpu (asking on Matrix). This commit adds a table of coordinate systems to help
clarify the issue.
The table comes from the DX12 backend documentation of gfx-rs:
https://github.com/gfx-rs/gfx/tree/master/src/backend/dx12
Remove trailing newlines from README
Host coordinate images locally
1719: hal/dx12: pass null to mapping rects r=kvark a=kvark
**Connections**
See https://github.com/baldurk/renderdoc/issues/2323
**Description**
Passing NULL rects is better for tooling, as it turns out.
**Testing**
Ran the examples
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1710: Check render bundle encoding for RODS r=cwfitzgerald a=kvark
**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1979
**Description**
Allows render bundles to be encoded for RODS.
In addition, validates that bundle RODS matches the pass RODS when executing. This part of the spec isn't written yet, and it's safer to be on the strict side.
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1718: Update naga to bbfa9a0, tweak DX12 debug output r=kvark a=kvark
**Connections**
Picks up #1132
**Description**
Also reduces the spam output of DX12 backend
**Testing**
Got skybox and water examples running!
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1713: hal/dx12: rewrite view creation, use arrays more aggressively r=kvark a=kvark
**Connections**
**Description**
D3D12 has this thing where you can't create a 2D view with non-zero base array index.
So we have special logic now to fall back to 2D array views in these cases.
**Testing**
Tested on the Shadow example.
Co-authored-by: Dzmitry Malyshau <kvarkus@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>