Commit Graph

3133 Commits

Author SHA1 Message Date
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]
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]
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
Gordon-F
f0b1d5a673 Update winit to 0.25 2021-07-23 14:30:38 +03:00
bors[bot]
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
bors[bot]
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]
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
bors[bot]
a32310096e Merge #1705
1705: Fix failure mode of adapter_request_device (direct backend) r=kvark a=dhardy

This function has a method for reporting errors, so it shouldn't panic IMO.

Possibly though we should adapt the `RequestDeviceError` type to have a `cause: Box<dyn Error>` payload? The `log::error` line is just because we have no other way of reporting this value.

I tried to test this, but...

- on v0.9 I couldn't make the request fail, even with requesting absurd limits like 1e9 something
- on master the adapter request succeeds, then the shader creation fails with `UnsupportedCapability(Float64)` (even though the request contains `wgpu::Features::SHADER_FLOAT64` and does not fail)

So the `direct` or Vulkan backend does not check features properly?

Co-authored-by: Diggory Hardy <git@dhardy.name>
2021-07-22 19:14:03 +00:00
bors[bot]
10638f830f Merge #1707
1707: Update naga revision r=kvark a=munrocket

**Connections**
https://github.com/gfx-rs/naga/pull/1096

**Description**
Updating `naga` with new WGSL operator `select(f, t, cons)`.

**Testing**
`cargo test` passed


Co-authored-by: munrocket <munrocket@pm.me>
2021-07-22 16:53:54 +00:00
munrocket
f909a8e631 update naga revision 2021-07-22 20:52:26 +04:00
bors[bot]
753cc25e13 Merge #1703
1703: Add Rgb9e5Ufloat Format r=kvark a=cwfitzgerald

**Connections**

Addresses part of #967, a wgpu-hal followup to #955.

**Description**

This adds only `Rgb9e5Ufloat`. I removed the explicit numbering from the texture format so we don't have to constantly re-number things. The default numbering is identical to what we were doing.

**Testing**

All backends unconditionally support it, so little testing is needed.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-22 05:22:48 +00:00
Dzmitry Malyshau
09c9ab5e75 Fix buffer memory initialization to use the tracker consistently 2021-07-22 01:19:53 -04:00
Connor Fitzgerald
683d03a8e4 Add Rgb9e5Ufloat 2021-07-21 23:54:46 -04:00
bors[bot]
5c28684bb1 Merge #1702
1702: Rename InputStepMode to VertexStepMode r=kvark a=kvark

**Connections**
https://github.com/gpuweb/gpuweb/pull/1927

**Description**
Just a rename

**Testing**
No need


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-21 21:50:12 +00:00
Dzmitry Malyshau
1a9a855ea9 Rename InputStepMode to VertexStepMode 2021-07-21 17:48:00 -04:00
bors[bot]
d1068e915c Merge #1701
1701: hal/vk: use actual view usage for imageless framebuffers r=kvark a=kvark

**Connections**
Fixes #1700

**Description**
Vulkan spec is confusing. See [attachment info](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFramebufferAttachmentImageInfo.html):
> usage is a bitmask of VkImageUsageFlagBits, matching the value of VkImageCreateInfo::usage used to create an image used with this framebuffer.

It doesn't talk about interaction with `ImageViewUsageCreateInfo`, which allows you to constrain the usage on a view.

**Testing**
Unable to test right now. `@initial-algebra` could you give it a spin?


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-21 18:34:30 +00:00
Diggory Hardy
4e98245d8b Fix failure mode of adapter_request_device (direct backend) 2021-07-21 17:49:25 +01:00
Dzmitry Malyshau
8a971fcf2e hal/vk: use actual view usage for imageless framebuffers 2021-07-21 12:14:20 -04:00
bors[bot]
2e80e881ea Merge #1698
1698: Feature-gate include_spirv macro r=cwfitzgerald a=dhardy

`wgpu::util::make_spirv` is gated behind the `spirv` feature; the `include_spirv` macro should be too.

Error before this change (with macro-backtrace on):
```
error[E0425]: cannot find function `make_spirv` in module `$crate::util`
  --> /home/dhardy/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/145da6a/wgpu/src/macros.rs:54:39
   |
48 | / macro_rules! include_spirv {
49 | |     ($($token:tt)*) => {
50 | |         {
51 | |             //log::info!("including '{}'", $($token)*);
...  |
54 | |                 source: $crate::util::make_spirv(include_bytes!($($token)*)),
   | |                                       ^^^^^^^^^^ not found in `$crate::util`
...  |
57 | |     };
58 | | }
   | |_- in this expansion of `include_spirv!` (#2)
   | 
  ::: kas-wgpu/src/draw/shaders.rs:24:1
   |
24 | / macro_rules! create {
25 | |     ($device:ident, $path:expr) => {{
26 | |         $device.create_shader_module(&include_spirv!($path))
   | |                                       --------------------- in this macro invocation (#2)
27 | |     }};
28 | | }
   | |_- in this expansion of `create!` (#1)
...
42 |           let frag_glyph = create!(device, "shaders/glyph.frag.spv");
   |                            ----------------------------------------- in this macro invocation (#1)
```


Co-authored-by: Diggory Hardy <git@dhardy.name>
2021-07-21 13:05:17 +00:00
Diggory Hardy
afc1951f9f Feature-gate include_spirv macro 2021-07-21 10:08:31 +01:00
bors[bot]
145da6af8b Merge #1696
1696: hal/dx12: reset command pool r=kvark a=kvark

**Connections**

**Description**
Fixes the memory leak in bunnymark on DX12

**Testing**
example!


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-20 14:40:59 +00:00
Dzmitry Malyshau
e9a2a1e438 hal/dx12: reset command pool 2021-07-20 10:39:40 -04:00
bors[bot]
849b3134e0 Merge #1694
1694: hal/dx12: fix the binding model r=kvark a=kvark

**Connections**
Depends on https://github.com/gfx-rs/naga/pull/1114
Makes the halmark + bunnymark run on DX12

**Description**
There was a mess-up in trying to use top-down layout...
Also fixes double-free on the queue in DX12.

**Testing**
Examples


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-20 14:08:39 +00:00
Dzmitry Malyshau
be13fe3048 hal/dx12: fix the binding model 2021-07-20 10:07:40 -04:00
bors[bot]
2f4be497e4 Merge #1692
1692: Avoid dev-dep on image r=cwfitzgerald a=Craig-Macomber

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_

#1610

**Description**
_Describe what problem this is solving, and how it's solved._

This removes image from the dev-deps, reducing build time/size.

Looks like noise was pulling in image with all formats enabled:
├── noise v0.7.0
│   ├── image v0.23.14

This was fixed in 1af9e15222 (diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542) which has not been released yet.

For now, we can workaround this with:
noise = { version = "0.7", default-features = false }

**Testing**
_Explain how this change is tested._

Ran `cargo build` as well as `cargo run --example water`

Co-authored-by: Craig <CraigM@CraigM.info>
2021-07-19 20:17:44 +00:00
bors[bot]
63823c3a3c Merge #1691
1691: Fix a couple of spelling errors in comments r=cwfitzgerald a=Craig-Macomber

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_

None.

**Description**
_Describe what problem this is solving, and how it's solved._

Fixes a couple spelling errors my spell checker highlighted when reading the source.

**Testing**
_Explain how this change is tested._

Spell checker stopped highlighting the words.

Co-authored-by: Craig <CraigM@CraigM.info>
2021-07-19 20:10:08 +00:00
Craig
7b4bd2f788 Avoid depending on image 2021-07-19 12:43:19 -07:00
Craig
e837a589ad Fix a couple of spelling errors 2021-07-19 11:25:19 -07:00
bors[bot]
1090110edb Merge #1687
1687: Update naga, use binding map in DX12 r=kvark a=kvark

**Connections**
Updates naga with https://github.com/gfx-rs/naga/pull/1105

**Description**
Establishes a binding map contract between dx12 backend and naga.

**Testing**
Gets the cube running, but there is something strange there.


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-18 16:04:48 +00:00
Dzmitry Malyshau
35145615bf Update naga, use binding map in DX12 2021-07-18 12:03:14 -04:00
bors[bot]
4e7c7a3b77 Merge #1676
1676: Add `Feature::SHADER_PRIMITIVE_INDEX` to support `builtin(primitive_index)` in fragment shaders r=kvark a=initial-algebra

**Connections**
https://github.com/gfx-rs/wgpu/issues/1669
https://github.com/gfx-rs/naga/pull/1097

**Description**
Allows fragment shaders to access the index of the current primitive via a new builtin variable.

**Testing**
Works on my machine.

- passes the capability to my fork of `naga` for basic validation and translation
- enables the `geometryShader` feature for Vulkan
- is refused by DX12

Needs to be implemented and tested for OpenGL, DirectX and Metal.

Co-authored-by: initial-algebra <67286231+initial-algebra@users.noreply.github.com>
2021-07-18 04:34:38 +00:00
initial-algebra
0db00e9657 Implement Feature::SHADER_PRIMITIVE_INDEX on Vulkan 2021-07-17 15:31:35 -03:00
bors[bot]
22139c6a46 Merge #1618
1618: webgpu: pass wgsl directly r=kvark a=grovesNL

**Connections**
Matrix conversation about passing WGSL to Gecko

**Description**
Gecko accepts WGSL now, so we can pass it directly instead of going through naga.

We could also consider converting SPIR-V to WGSL soon, assuming nobody is relying on the SPIR-V path with older versions of Gecko. We could do that in a separate PR though.

**Testing**
Tried hello-compute locally, using the examples HTML file and creating wasm with something like
```
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --release --example hello-compute --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/release/examples/hello-compute.wasm --out-dir target/generated --web
```

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-07-17 03:09:10 +00:00
Joshua Groves
cd12afa1db webgpu: remove naga dependency 2021-07-16 22:12:21 -02:30
Joshua Groves
4b7dac0e43 webgpu: pass wgsl directly 2021-07-16 22:11:59 -02:30
bors[bot]
6fa8845465 Merge #1673
1673: hal/vk: relay semaphore r=Ralith a=kvark

**Connections**
Somewhere on the Matrix, by @pythonesque

**Description**
Vulkan (somewhat confusingly) requires semaphore synchronization between `vkQueueSubmit` and `vkQueuePresent` *even if* it's done on the same queue.
This PR exercises a dumb idea of just keeping one binary semaphore as a "relay" between all queue commands, all concealed within hal/vk backend.

**Testing**
Running Halmark shows that all the things break here. I'm not seeing anything particularly wrong with the code though. My humble guess is that AMD driver (at least) isn't happy about the mix of binary and timeline semaphores used together in the same signal operation.


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-16 21:55:37 +00:00
Dzmitry Malyshau
5419947095 hal/vk: relay semaphore 2021-07-16 17:55:03 -04:00
bors[bot]
6c711adb9b Merge #1671
1671: Use EGL_KHR_gl_colorspace for srgb if available r=kvark a=cwfitzgerald

**Connections**

Fixes #1667 

**Description**

Uses the extension to provide SRGB if needed relevant.

I also promoted the log message about missing robustness to a warning because it is a safety issue.

**Testing**

Tested on rpi and haswell.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-16 05:05:39 +00:00
Connor Fitzgerald
0f84c7cf6e Use EGL_KHR_gl_colorspace for srgb if available 2021-07-16 01:03:18 -04:00
bors[bot]
22a81de6a9 Merge #1665
1665: (macOS/iOS) readWriteTextureSupport is support on macOS 10.13+ / iOS 11.0 r=kvark a=xiaopengli89

```
[MTLIGAccelDevice readWriteTextureSupport]: unrecognized selector sent to instance 0x7f97d1070a00
```
https://developer.apple.com/documentation/metal/mtldevice/2887289-readwritetexturesupport?language=objc


Co-authored-by: xiaopengli89 <x.friday@outlook.com>
2021-07-15 15:07:38 +00:00
xiaopengli89
6e63964e51 fix: readWriteTextureSupport is support on macOS 10.13+ / iOS 11.0 2021-07-15 14:40:05 +08:00
bors[bot]
e1392a3525 Merge #1664
1664: hal/dx12: reset scissor and viewport r=kvark a=kvark

**Connections**
Follow-up to #1602 that actually makes it render!

**Description**
"hello-triange" and "msaa-line" examples work now.
Everything else is blocked on Naga's HLSL output, starting from https://github.com/gfx-rs/naga/pull/1086

**Testing**
Ran the examples :)


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-15 06:13:05 +00:00
Dzmitry Malyshau
b98cba9bfd hal/dx12: reset scissor and viewport 2021-07-15 02:10:28 -04:00
bors[bot]
a4a90c09f4 Merge #1663
1663: hal/dx12: flip the root signature upside down r=kvark a=kvark

**Connections**
Another follow-up to #1602

**Description**
Apparently, Microsoft recommends putting most frequently changed stuff at the bottom of root signature.

**Testing**
Unable to test yet.


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-15 06:00:18 +00:00
Dzmitry Malyshau
e2bd9c935c hal/dx12: flip the root signature upside down 2021-07-15 01:37:49 -04:00
bors[bot]
eb68c5ec8b Merge #1662
1662: [Docs] Removed metal from platforms that support multi draw indirect r=cwfitzgerald a=Vengarioth

**Connections**
Discussed on [matrix](https://matrix.to/#/!XFRnMvAfptAHthwBCx:matrix.org/$3mJo3ZEKOBzWs9CpgSJDo_iyynZpZlYinW9Xqp3aeVs?via=matrix.org&via=kyju.org&via=mozilla.org).

**Description**
Removed metal from the platforms that support multi draw indirect

**Testing**
`cargo test --doc`


Co-authored-by: Andreas Fischer <opensource@deviru.de>
2021-07-15 05:26:08 +00:00