Commit Graph
1303 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau 4de1d24bc6 Merge #898
898: Update naga with improved SPIR-V parsing and reflection r=cwfitzgerald a=kvark

**Connections**
Fixes #892
Fixes #899
Includes https://github.com/gfx-rs/naga/pull/153 and the awesome https://github.com/gfx-rs/naga/pull/122
Also includes https://github.com/gfx-rs/naga/pull/157 now.

**Description**
This PR updates naga and our validation code.
~~We can successfully validate only `hello-triangle` and `cube` examples, still.~~
We mostly pass the validation of the examples now!
Meta-issue filed in https://github.com/gfx-rs/naga/issues/155 to unlock the rest.

**Testing**
Tested on examples in https://github.com/gfx-rs/wgpu-rs/pull/537

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-27 21:06:27 +00:00
bors[bot]andMikko Lehtonen 9b65d7433f Merge #902
902: Address nits in #897 r=cwfitzgerald a=scoopr



Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-08-27 20:10:11 +00:00
Mikko Lehtonen 5fab78e175 Address nits in #897 2020-08-27 22:11:42 +03:00
Dzmitry Malyshau ceac2344fc Update naga to bd9efe5915 2020-08-27 11:52:02 -04:00
Dzmitry Malyshau 03becf1a17 Force width=4 in all shader-matched variables 2020-08-26 15:53:39 -04:00
Dzmitry Malyshau b5475d7d80 Update naga to 4797773152 2020-08-26 15:35:14 -04:00
bors[bot]andMikko Lehtonen 5b67fe71f8 Merge #897
897: Improve diagnostics of incompatible attachments r=kvark a=scoopr

**Description**
Attempt to improve the diagnostics of incompatible attachments


Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-08-26 13:18:54 +00:00
Mikko Lehtonen dbd6081a8e Improve diagnostics of incompatible attachments 2020-08-26 10:03:44 +03:00
bors[bot]andKunal Mohan 59f0996eab Merge #895
895: Improve validation in B2B copies and RenderCommands r=kvark a=kunalmohan

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

**Description**
_Describe what problem this is solving, and how it's solved._
Validation for the following have been added-
- Validate all parameters in B2B copy even if `copy_size == 0`.
- Check for copy operations issued within same buffer.
- `RenderPass.setViewport()`
- `RenderPass.setScissorRect()`

**Testing**
_Explain how this change is tested._
Tested with CTS in Servo. More tests pass now. Will test on wgpu-rs now.
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
2020-08-24 18:00:47 +00:00
bors[bot]andDzmitry Malyshau bf734d1005 Merge #893
893: Improve texture creation validation r=cwfitzgerald a=kvark

**Connections**
Fixes https://github.com/gfx-rs/wgpu-rs/issues/528#issuecomment-678853886

**Description**
Improves the mipmap levels check.
Note that it also removes the `TooManyLayers` error, and instead produces max `u16` value. This is to be followed up with a check for *real* limits, which has to happen regardless, and trying to catch it on the number conversion step seems wasteful.

**Testing**


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-24 17:49:10 +00:00
Dzmitry Malyshau 0779a5ce2f Allow CI fail on Windows Nightly, for now 2020-08-24 13:48:08 -04:00
Kunal Mohan a10e5cdb53 Check whether attachments are of same size or not 2020-08-24 23:02:04 +05:30
Dzmitry Malyshau b8b7561796 Improve texture creation validation 2020-08-24 13:00:34 -04:00
Kunal Mohan f266431f24 Improve validation in b2b copies and RenderCommands 2020-08-24 21:14:07 +05:30
bors[bot]andJustin Shrake 0bb6bb8647 Merge #891
891: Add AddressMode::ClampToBorder behind a feature r=kvark a=jshrake

**Connections**
Closes #890 
Linked to https://github.com/gfx-rs/wgpu-rs/pull/526

**Description**
- Adds support for border sampler addressing behind a new feature Features::ADDRESS_MODE_CLAMP_TO_BORDER.
- Adds a new enum SamplerBorderColor so that users can optionally specify a supported border color on the SamplerDescriptor.

**Testing**
Tested against the Metal (MacOS 10.15) and Vulkan (Ubuntu 18.04) backends.

Ran the wgpu-rs/cube example and switched the address modes to AddressMode::ClampToBorder, without enabling the feature, and confirmed I received an error message. Ran the same example with the new feature specified in the optional_features return and confirmed that the example ran and looks reasonable.

Co-authored-by: Justin Shrake <justinshrake@gmail.com>
2020-08-22 21:46:19 +00:00
Justin Shrake 19eeee27ee Add AddressMode::ClampToBorder behind a feature 2020-08-22 13:23:50 -07:00
bors[bot]andDzmitry Malyshau 85b18562ce Merge #889
889: Fix swapchain preferred format r=kvark a=kvark

**Connections**

**Description**
The old API was wrong because the idea is to query the format *before* creating a swapchain, not after it:)

**Testing**
nah, should just work

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-21 16:33:56 +00:00
Dzmitry Malyshau 6f1d6145f5 Fix swapchain preferred format 2020-08-21 12:31:52 -04:00
bors[bot]andConnor Fitzgerald 1d0e0ce37e Merge #885
885: Improve buffer and texture overrun error messages r=kvark a=cwfitzgerald

**Connections**

Closes #884.

**Description**

The previous errors about buffer and texture overruns didn't tell the user any information about which buffer, how long wgpu thought the copy was, or how long it thought the buffer was. This makes the error message much better.

Unfortunately a braking change, so can't backport :(

**Testing**

Tested on #884's issue.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-08-19 15:45:49 +00:00
Connor Fitzgerald f9265bccd2 Improve buffer and texture overrun error messages 2020-08-19 11:44:54 -04:00
bors[bot]andNoah Charlton 961140fb24 Merge #883
883: fix typo in vertex format documentation r=kvark a=DevOrc

**Connections**
None
**Description**
fix typo in vertex format documentation

**Testing**
Ran `cargo doc`


Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
2020-08-18 14:59:05 +00:00
Noah Charlton c58ee9c54e fix typo in vertex format documentation 2020-08-18 10:28:42 -04:00
bors[bot]andDzmitry Malyshau 1605044c05 Merge #882
882: Version bump to 0.6 and changelog update r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-18 14:10:10 +00:00
Dzmitry Malyshau 901b043b19 Version bump to 0.6 and changelog update wgpu-types-v0.6.0 wgpu-core-v0.6.0 2020-08-17 16:51:22 -04:00
bors[bot]andConnor Fitzgerald 2a31677872 Merge #881
881: Factor wgpu-subscriber into its own repo r=kvark a=cwfitzgerald

**Connections**

Closes #871 

**Description**

Removes wgpu-subscriber crate into its own repo.

**Testing**

Compile only change.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-08-17 20:40:21 +00:00
Connor Fitzgerald 350637df40 Factor wgpu-subscriber into its own repo 2020-08-17 16:36:22 -04:00
bors[bot]andDzmitry Malyshau 096c57008f Merge #880
880: Port to gfx-hal-0.6 r=kvark a=kvark

This got a little more involved than I hoped, because of https://github.com/rust-lang/rust/issues/34433 which is unfortunately closed.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-17 14:57:03 +00:00
Dzmitry Malyshau d1da6d8106 Switch gfx-hal to 0.6 2020-08-17 10:34:50 -04:00
bors[bot]andJohn Mitchell f7ec6cc1fe Merge #877
877: Add image cube array feature. r=kvark a=StarArawn

**Connections**
None

**Description**
Enable `IMAGE_CUBE_ARRAY` in vulkan and dx12. Note: Currently this will cause metal to break as the `available_features` from the physical device will never include `IMAGE_CUBE_ARRAY`. Thus I'm opening this as a draft until gfx-hal metal can check and pass the feature on.

**Testing**
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->
I can test this with my repo using wgpu-rs here which uses cube arrays:
https://github.com/StarArawn/harmony/


Co-authored-by: John Mitchell <toasterthegamer@gmail.com>
2020-08-17 03:29:15 +00:00
John Mitchell 4cb50e8395 Added image cube array. 2020-08-16 23:10:06 -04:00
bors[bot]andConnor Fitzgerald 3146950cf7 Merge #879
879: Move push constant docs to correct feature r=kvark a=cwfitzgerald

**Connections**

Closes #878 

**Description**

Somehow put a push constant feature in the wrong place.

**Testing**

Docs only.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-08-17 00:44:13 +00:00
Connor Fitzgerald abb3c2f8db Move push constant docs to correct feature 2020-08-16 19:52:53 -04:00
bors[bot]andDzmitry Malyshau 7e8b51b428 Merge #876
876: Fix support for d24unorm format r=kvark a=kvark

**Connections**
fixes https://github.com/kvark/vange-rs/pull/121 on some platforms

**Description**
We used to associate `D24Plus` with internal `D24S8`. This results in assuming that it has both DEPTH + STENCIL. Creating a binding from it then fails with the `All` aspect, since you can't view both. This is unexpected, since the user creates `D24Plus` with just a single aspect.

**Testing**
None needed

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-08-13 21:29:44 +00:00
Dzmitry Malyshau 44fdfb80d0 Fix support for d24unorm format 2020-08-13 17:26:44 -04:00
bors[bot]andDzmitry Malyshau 92aaa2bba6 Merge #875
875: Add labels to pipelines r=trivial a=kvark

This isn't functional until gfx-hal-0.6 is published, but the API is there.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-13 16:16:17 +00:00
Dzmitry Malyshau d8341c5996 Add labels to pipelines 2020-08-13 12:14:24 -04:00
bors[bot]andDzmitry Malyshau 6e3e88dd10 Merge #873
873: Grand cleanup and refactor of the descriptors in the API r=cwfitzgerald,grovesNL a=kvark

**Connections**
Cleanup follows https://github.com/gfx-rs/wgpu-rs/pull/501
Fixes #871 
Fixes #848

**Description**
There is a lot of small and big things crumbled in here.

The major one is where descriptors live, and how they are parametrized. Logic is the following:
  - if something is useful by wgpu-rs's API leave it in `wgpu-types`
  - if *in addition* it's useful to `wgpu-native`(i.e. has `repr(C)`),  we possibly parametrize it (currently, only label is).
  - otherwise, the type is moved to `wgpu-core` and stripped of generics
  - remove all the builders

Some medium-sized things:
  - moves the subscriber out (#871)
  - moves the `RenderCommand` into the `draw` module (which is meant to contain shared things)
  - makes `TextureViewDescriptor` fields optional, but receives it directly now (#848)
  - moves stencil stuff out into `StencilStateDescriptor`, so that we can derive `Default` for it
  - stop accepting raw strings for labels in the `Device` API: neither the clients, or gfx-rs need that shape, and it can't be safe

Some smaller things:
  - using NonZeroU8 for anisotropy
  - using NonZeroU32 for descriptor count
  - putting sampler addressing modes into an array
  - add labels to command buffers and pipeline layouts
  - improves errors for exceeding binding limits

**Testing**
Tested on https://github.com/gfx-rs/wgpu-rs/pull/503


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-13 03:19:44 +00:00
Dzmitry Malyshau 2473c25971 Refactor the stencil state descriptor a bit 2020-08-12 20:04:47 -04:00
Dzmitry Malyshau d07d8503a0 Move the subscriber into a different crate 2020-08-12 15:00:15 -04:00
Dzmitry Malyshau a0711cf9b2 Move the RenderCommand into the shared draw module 2020-08-12 14:33:42 -04:00
Dzmitry Malyshau 9d8dc0b04d Grand cleanup and refactor of the descriptors in the API 2020-08-12 14:13:32 -04:00
bors[bot]andDzmitry Malyshau 04f5cfd1c8 Merge #872
872: Respect texture view aspect on creation r=cwfitzgerald a=kvark

**Connections**
Fixing https://github.com/gfx-rs/wgpu-rs/issues/498 (but needs wgpu-rs update then)

**Description**
We added the aspect field to texture view descriptor but didn't respect it properly.
We do that now, and also disallow Depth-Stencil sampled views

**Testing**
Used the modified water example for testing.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-08-10 20:16:45 +00:00
Dzmitry Malyshau 1f5622a0b3 Respect texture view aspect on creation 2020-08-10 16:14:20 -04:00
bors[bot]andDzmitry Malyshau 12352035f0 Merge #870
870: Implicit layout r=cwfitzgerald a=kvark

**Connections**
Closes #868

**Description**
The implementation can be split into 3 parts:
  1. reflecting the shader for binding expectations, and building a bind entry map from it, merging them between stages. This is only done for shaders that can be reflected, and we error on the rest, for now.
  2. based on this info, create new bind group layouts and pipeline layouts. The tricky part here is that we can't generate the ID out of thin air, so we have to pass them into the `create_xx_pipeline` function, which now also returns the number of IDs it consumed, allowing the client to free the rest.
  3. API changes in the descriptors, new methods to obtain the bind group layouts from a pipeline

**Testing**
This isn't tested, but I think it's fine: it doesn't affect the old path, and we'll be testing the new path while improving Naga and our reflection anyway.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-08-10 18:38:34 +00:00
Dzmitry Malyshau f164fd1f46 Bump BGL refcounts on getting them from pipelines 2020-08-10 10:11:31 -04:00
Dzmitry Malyshau 55064ace4c New get_bind_group_layout functions 2020-08-09 18:33:47 -04:00
Dzmitry Malyshau d8efe3b6fe Attempt to unite implicit layout code between compute and render 2020-08-09 18:16:03 -04:00
Dzmitry Malyshau 173c7c3dbf Create implicit layouts for render pipelines 2020-08-09 14:43:44 -04:00
Dzmitry Malyshau a9b8a99e19 Create implicit layouts for compute pipelines 2020-08-09 08:33:33 -04:00
Dzmitry Malyshau f18fa7ef9b Derive bind group layout entries in Naga validation 2020-08-08 01:09:41 -04:00