Commit Graph
9013 Commits
Author SHA1 Message Date
bors[bot]andConnor Fitzgerald 9ce884c384 Merge #1732
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>
2021-07-27 13:10:45 +00:00
bors[bot]andDzmitry Malyshau 2940347ba3 Merge #1731
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>
2021-07-27 13:01:30 +00:00
Dzmitry Malyshau 69f808c54a hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
Connor Fitzgerald d6a8ab7b34 Allow vertex_storage_textures to be 0 2021-07-27 02:37:15 -04:00
Connor Fitzgerald eb33efb110 Mark WARP as known failure on water 2021-07-27 02:15:46 -04:00
Dzmitry Malyshau a7ac13a61d hlsl: special constants for base vertex/index 2021-07-27 01:49:03 -04:00
Markus Siglreithmaier 79f29c8809 Merge pull request #35 from gfx-rs/root-const
Setting root constants
2021-07-27 07:46:54 +02:00
Dzmitry Malyshau 3e88f3dc63 Setting root constants 2021-07-27 01:29:05 -04:00
Gordon-F d3243bd774 [glsl-out] Enable access snapshot testing 2021-07-26 13:53:48 -04:00
Dzmitry Malyshau 9648579dcb Merge pull request #34 from gfx-rs/indirect
Expose all indirect argument types
2021-07-26 13:52:13 -04:00
Dzmitry Malyshau 2061f6a893 Expose all indirect argument types 2021-07-26 13:51:32 -04:00
Dzmitry Malyshau 46d2d6819e Fix matrix size computation 2021-07-26 10:40:47 -04:00
bors[bot]andDzmitry Malyshau 6cfe8bdb28 Merge #1724
1724: hal/dx12: compact register allocation, naga update r=kvark a=kvark

**Connections**
Heavily depends on https://github.com/gfx-rs/naga/pull/1136

**Description**
Makes DX12 to run all of the examples 🎉 .

**Testing**
Re-enables DX12 in `PRIMARY` set, which also enables the reference tests on it.

![wgpu-dx12-shadow](https://user-images.githubusercontent.com/107301/126940717-aefad5b2-1eba-4523-ba6a-53a5744ba313.JPG)



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-26 06:14:05 +00:00
Dzmitry Malyshau 405cf57955 hal/dx12: compact register allocation, naga update 2021-07-26 02:01:14 -04:00
Dzmitry Malyshau e97c8f9441 hlsl: fix storage offset, continuing statement 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau a5c2cef9ab hlsl: transpose storage matrices 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau e7502d0a9b hlsl: factor storage logic into a separate module 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau 284cfcce47 hlsl: storage writes 2021-07-26 01:29:42 -04:00
Dzmitry Malyshau 4b6846d5da hlsl: storage reads support, array length 2021-07-26 01:29:42 -04:00
bors[bot]andRiccardo Zaglia 3eb3eed8cf Merge #1609
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>
2021-07-26 05:03:13 +00:00
bors[bot]andZicklag ee9e1452d5 Merge #1717
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>
2021-07-26 04:57:17 +00:00
Riccardo Zaglia 2657849977 [Vulkan] Initialize wgpu objects from raw handles 2021-07-25 21:51:40 +02:00
Gordon-F 526a29e2b8 [glsl-out] Fix array type writing and zero initialization for local variables 2021-07-24 17:53:24 -04:00
Gordon-F 9bd0abb987 [hlsl-out] Fix local variable writing with array type 2021-07-24 17:53:24 -04:00
Gordon-F 7dd9e14a3d Add note about sint array size in comment 2021-07-24 17:53:24 -04:00
Gordon-F 7bb28201dd Allow to translate from bool to another type in validator 2021-07-24 17:53:24 -04:00
Gordon-F 3000232844 [hlsl-out] Write sint array size 2021-07-24 17:53:24 -04:00
Zicklag 0a66eef822 Work Around Fastclear Bug for Web and Native GL 2021-07-24 15:36:49 -05:00
Michael MacLeod fd33ac36d4 Document coordinate systems in README
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
2021-07-24 13:17:04 -07:00
bors[bot]andZicklag dd1be1ff62 Merge #1721
1721: Tweak Water Example to Show Off Water Shader a bit More r=cwfitzgerald a=zicklag

**Connections**
None

**Description**
Tweaks the water shader example terain and camera to show off the cool water shader a little bit more. 😄


https://user-images.githubusercontent.com/25393315/126842645-e353c0eb-57fc-4b8e-9e0d-901f08c7e9f7.mp4



**Testing**
Tested on vulkan and GL on linux.


Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-24 20:16:51 +00:00
Zicklag 7fab8e213c Tweak Water Example to Show Off Water Shader More 2021-07-24 15:04:42 -05:00
bors[bot]andDzmitry Malyshau d5a477fe60 Merge #1719
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>
2021-07-23 16:24:12 +00:00
Dzmitry Malyshau 2158cdd43b hal/dx12: pass null to mapping rects 2021-07-23 12:19:59 -04:00
Igor Shaposhnik ff14f04734 [glsl-out] Fix bitcast operation for the same types 2021-07-23 11:47:46 -04:00
bors[bot]andDzmitry Malyshau 5dd3f6ba6b Merge #1710
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>
2021-07-23 15:36:32 +00:00
Dzmitry Malyshau 52734bf87a Fix tracing feature for RODS 2021-07-23 11:33:22 -04:00
Dzmitry Malyshau 34b68121c6 Check bundle RODS against pass RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau bb218c1580 Check render bundle encoding for RODS 2021-07-23 11:24:05 -04:00
bors[bot]andGordon-F 35896df3b7 Merge #1716
1716: Update winit to 0.25 r=kvark a=Gordon-F

**Connections**


**Description**
Update winit to 0.25

**Testing**
Examples


Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-07-23 15:05:45 +00:00
bors[bot]andDzmitry Malyshau 29f9e2a58e Merge #1718
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>
2021-07-23 14:51:08 +00:00
Dzmitry Malyshau 8dc4942431 Update naga to bbfa9a0, tweak DX12 debug output 2021-07-23 10:48:32 -04:00
Dzmitry Malyshau bbfa9a0f9e hlsl: remove the boolean casts for unary operators 2021-07-23 10:41:36 -04:00
Gordon-F f0b1d5a673 Update winit to 0.25 2021-07-23 14:30:38 +03:00
bors[bot]andDzmitry Malyshau a0bcd86207 Merge #1714
1714: Update Naga to cc91c77 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/naga/pull/1128 and other HLSL fixes.
Complements #1713

**Description**
Just an update

**Testing**
Ran examples locally 


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-23 06:20:11 +00:00
Dzmitry Malyshau 2c45796d9c Update Naga to cc91c77 2021-07-23 02:19:42 -04:00
Dzmitry Malyshau cc91c77f7a hlsl: fix vector multiplication 2021-07-23 02:11:32 -04:00
bors[bot]andDzmitry Malyshau 1f7d60d065 Merge #1713
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>
2021-07-23 06:07:18 +00:00
bors[bot]andDzmitry Malyshau 5ef620ace8 Merge #1704
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>
2021-07-23 04:48:42 +00:00
Dzmitry Malyshau 726cf4f614 hal/dx12: rewrite view creation, use arrays more aggressively 2021-07-23 00:07:23 -04:00
Dzmitry Malyshau c526383cf8 hlsl-out: write StructuredBuffer 2021-07-22 15:44:26 -04:00