637 Commits

Author SHA1 Message Date
Dzmitry Malyshau
56df63b122 Fix coalescing of descriptor sets 2020-10-11 22:47:41 -04:00
bors[bot]
f963193be1
Merge #966
966: Immediate resource destruction and freeing r=cwfitzgerald a=kvark

**Connections**
Fixes #964

**Description**
We are making it so a buffer or a texture can have their native resources freed while they are still referenced, so without waiting for GC.

In addition, the PR adds a few missing cases where error IDs should have been handled, like at render pass encoding.

**Testing**
Tested on wgpu-rs examples, see https://github.com/gfx-rs/wgpu-rs/pull/591

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-10-11 17:10:42 +00:00
Dzmitry Malyshau
c87a94f976 Early texture destruction 2020-10-08 23:21:11 -04:00
PENGUINLIONG
6f4508523a
Pass [u8] instead of [u32] for push constants (#918)
* Pass [u8] instead of [u32] for push constants

Use 2-instruction aligner

Fixed alignment

Fixed offsets

Added alignment checks and fixed size

Use semantic constants

* Replaced all magic number with constant

* Fixed type cast
2020-10-08 23:13:18 -04:00
Dzmitry Malyshau
c4c8e3b224 Early buffer destruction logic 2020-10-08 22:28:52 -04:00
Dzmitry Malyshau
0a7d81351c Handle cases where buffer contents are destroyed 2020-10-08 12:57:17 -04:00
Dzmitry Malyshau
50594a747d Another small Naga update 2020-10-07 16:14:25 -04:00
Dzmitry Malyshau
0070bf703c Coalesce bindings into a single write 2020-10-07 16:14:25 -04:00
Dzmitry Malyshau
962e4dbaf7 Defer bind group creation to after validation 2020-10-07 16:14:25 -04:00
bors[bot]
aee0bead78
Merge #963
963: Add repr(C) on mapping structs r=trivial a=kvark

**Connections**
Required for https://phabricator.services.mozilla.com/D92636

**Description**
Allows C clients to avoid redefining those structs.

**Testing**
No need

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-10-06 17:37:45 +00:00
Dzmitry Malyshau
dc2d581c8d Add repr(C) on mapping structs 2020-10-06 13:36:17 -04:00
Dzmitry Malyshau
45ade807cc Only request features that are needed 2020-10-05 14:51:32 -04:00
Dzmitry Malyshau
0a67d6a7be Enable RBA feature where available 2020-10-05 10:21:39 -04:00
bors[bot]
bcb3162b2b
Merge #947
947: Update naga with the new usage validation r=cwfitzgerald a=kvark

**Connections**
Includes https://github.com/gfx-rs/naga/pull/200, https://github.com/gfx-rs/naga/pull/203, https://github.com/gfx-rs/naga/pull/214, and others

**Description**
We get more comprehensive validation, which can sometimes be annoying :)

**Testing**
Tested on wgpu-rs examples.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-10-01 16:05:42 +00:00
Dzmitry Malyshau
c18ac58fd8 Update naga with the new usage validation 2020-09-28 10:18:35 -04:00
lberrymage
41228ef1a4
Fix clippy warnings about using if-let over match
The specific lint triggered was
https://rust-lang.github.io/rust-clippy/master/index.html#single_match.
2020-09-25 23:02:51 -08:00
Adam Nemecek
db1870e7fc use self 2020-09-25 19:11:46 -07:00
Leon Scherer
1fecbe18ed Fixed typo in texture size check 2020-09-25 14:21:38 +02:00
bors[bot]
a56f9949ec
Merge #938
938: Remove erroneous extra feature check r=kvark a=cwfitzgerald

**Connections**

None, found during investigation of DI issue.

**Description**

This line of code just shows up twice in a row, checking the same feature and setting the same feature.

**Testing**

Untested, but shouldn't affect anything.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-09-24 13:18:04 +00:00
Dzmitry Malyshau
0345c56758 Properly implement compute pass usage scopes 2020-09-23 19:01:47 -04:00
Connor Fitzgerald
a9750f83bc Remove erroneous extra feature check 2020-09-23 18:13:54 -04:00
Kunal Mohan
485dab9a52 Prevent an invalid texture from being registered in device_create_texture 2020-09-23 00:30:50 +05:30
Mikko Lehtonen
8252758674 Reverts the addition of LabeledContextError
Removed as discussed, moving them to wgpu-rs side
2020-09-14 22:45:10 +03:00
Kunal Mohan
d423d3d5d7
Allow dropping of error resources (#925)
* Allow dropping of error resources

* Unregister error resources without panic
Panic when removing Vacant element or when index is out of range

* address review comments
2020-09-13 21:17:53 -04:00
Dzmitry Malyshau
6a3c106cc4 Update naga with new image API 2020-09-11 12:34:20 -04:00
Manuel Woelker
336d070b26 add polygon_mode: PolyonMode to RasterizationStateDescriptor to allow drawing wireframes 2020-09-09 21:34:37 +02:00
Mikko Lehtonen
2fb8fc34d2 Add LabeledContextError
Purpose for this is to add more context to an error.
create_render_pipeline error is improved, by showing the action
(creating render pipeline) and the user provided label, to aid with
the investigation.
2020-09-08 17:44:53 +03:00
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
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
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
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
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
Mikko Lehtonen
5fab78e175 Address nits in #897 2020-08-27 22:11:42 +03:00
Dzmitry Malyshau
ceac2344fc Update naga to bd9efe5915e548b9a2ec1f3d3e9296c90b31e69a 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 479777315211f23f640dc53977eecd46ced6aaf6 2020-08-26 15:35:14 -04: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
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
Justin Shrake
19eeee27ee Add AddressMode::ClampToBorder behind a feature 2020-08-22 13:23:50 -07:00
Dzmitry Malyshau
6f1d6145f5 Fix swapchain preferred format 2020-08-21 12:31:52 -04:00