Commit Graph

1471 Commits

Author SHA1 Message Date
Ben Frankel
2ee07a2a47 Fix invalid mip level count check 2020-09-07 16:49:06 -07:00
Dzmitry Malyshau
68bf10a3a5 Fix invalidated segment of the staging memory 2020-09-06 20:37:03 -04:00
bors[bot]
5cfdd4a135
Merge #920
920: Don't bind groups that aren't expected by the layout  r=grovesNL a=kvark

**Connections**
Sibling of #919 for master.

**Description**

**Testing**
In addition to the fix itself, this comes with a new regression playtest!

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-09-06 02:22:02 +00:00
Dzmitry Malyshau
eed8bf84ef Playtest for binding a group 2020-09-04 23:47:24 -04:00
Dzmitry Malyshau
1886149cae Don't bind groups that aren't expected by the layout 2020-09-04 23:47:24 -04:00
bors[bot]
3f1abf571e
Merge #908
908: Clarify usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING r=cwfitzgerald a=im-0

**Connections**
https://github.com/gfx-rs/wgpu-rs/pull/540

**Description**
This clarifies usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING with GLSL.

**Testing**
This commit only changes documentation.

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2020-09-02 20:43:32 +00:00
bors[bot]
bbb9b84bd2
Merge #916
916: Flush staging init buffers r=cwfitzgerald a=kvark

**Connections**
Related to https://github.com/gfx-rs/gfx/pull/3362
With the new use of `write_buffer`/`write_texture`, the results on D3D11 regressed.

**Description**
It just happened to be the case that all the backends returned coherent staging buffers, used internally for `write_*` and `mapped_at_creation == true`. However, D3D11 backend currently doesn't have the coherent memory at all, and it helped me to see that we were missing a flush() on the staging buffer.

**Testing**
Untested, but should work (tm).

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-09-02 20:24:41 +00:00
Dzmitry Malyshau
35d2ed39b5 Flush staging init buffers 2020-09-02 15:58:32 -04:00
bors[bot]
6df8421f22
Merge #909
909: Add Quad play test r=kvark a=DevOrc

**Connections**
#807 

**Description**
Adds a play test that renders a white quad to a texture. The texture is then copied to a buffer and checked for accuracy with a file of expected bytes (All 0xFF). 

**Testing**
Cargo test succeeds

Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
2020-09-01 20:18:21 +00:00
Noah Charlton
d05d1aeec1 Add Quad play test 2020-09-01 16:07:24 -04:00
bors[bot]
ca7f6aee9a
Merge #910
910: Replace backends! Macro with CFG Aliases r=kvark a=zicklag

**Connections**
Needs to be merged before: https://github.com/gfx-rs/wgpu/pull/907

**Description**
This change makes it easier to conditionally compile code based on graphics backends by adding `#[cfg]` aliases for the backends such as `vulkan`, `metal`, etc. This makes the code easier to read and maintain.

**Testing**
Tested the WGPU-rs cube and boids examples and they work as normal on a Linux machine with Vulkan.

Co-authored-by: Zicklag <zicklag@katharostech.com>
2020-08-31 04:33:42 +00:00
bors[bot]
128ead0141
Merge #912
912: Fix write-only stencil state descriptors from not working - fixes #911 r=kvark a=Dinnerbone

**Connections**
This fixes [#911 - Stencil testing broken between v0.5 and v0.6](https://github.com/gfx-rs/wgpu/issues/911).

**Description**
Write-only stencil states (read 0, write >0) are being treated as if they are disabled, which causes pipelines to act as though they don't have any stencil state set at all. This worked prior to commit 2473c25971 (introduced in PR #873). As far as I can tell, this works fine in Vulkan, Metal, DX12 and DX11 as we've been using this approach over at Ruffle for a while now.

**Testing**
You can view the reproduction case in #911 for manual testing. I have confirmed that this fix makes that case work as expected.

I couldn't find any automated tests for wgpu-types to copy and add for this case. If that's wanted then please let me know what the best approach is.

Co-authored-by: Nathan Adams <dinnerbone@dinnerbone.com>
2020-08-31 03:51:17 +00:00
Nathan Adams
0e94752749 Fix write-only stencil state descriptors from not working - fixes #911 2020-08-30 23:33:09 +02:00
Zicklag
7572dbeaf9 Use CFG Aliases to Replace the backends! Macro
Uses the `cfg_aliases` crate to replace the `backends!` macro and
provide a more natural way to gate backend specific code.
2020-08-29 21:55:17 -05:00
Ivan Mironov
9557ab36a6 Clarify usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING 2020-08-30 00:47:00 +05:00
bors[bot]
bba82724a8
Merge #903
903: fix for mixed STORAGE_STORE and STORAGE_LOAD r=kvark a=kocsis1david

**Connections**
None

**Description**
A buffer that contains dynamic data is used for both uniforms and storage read. This was a problem for wgpu and it gave a `PendingTransition` error.

**Testing**
It's a trivial fix, but I don't know if there's an example for it in wgpu-rs that can be used for testing.

It seems that the PR "Sync changes from mozilla-central" is already solving the same issue.


Co-authored-by: Dávid Kocsis <kocsis1david@windowslive.com>
2020-08-28 16:10:55 +00:00
Maximilian Lupke
5d50b2ac24
Allow copying from depth textures (#901)
* Allow copying from depth textures

* Rename TextureFormat::is_depth_format to just is_depth

* Only allow Depth32Float format for copying, and only as source
2020-08-28 10:58:48 -04:00
Dávid Kocsis
5ea3ea7b55 fix for mixed STORAGE_STORE and STORAGE_LOAD 2020-08-28 07:23:38 +02:00
bors[bot]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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 2020-08-17 16:51:22 -04:00
bors[bot]
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]
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]
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]
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