Commit Graph
408 Commits
Author SHA1 Message Date
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]andNoah Charlton 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]andDávid Kocsis 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]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
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
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
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
Connor Fitzgerald f9265bccd2 Improve buffer and texture overrun error messages 2020-08-19 11:44:54 -04:00
Dzmitry Malyshau 901b043b19 Version bump to 0.6 and changelog update 2020-08-17 16:51:22 -04:00
Dzmitry Malyshau d1da6d8106 Switch gfx-hal to 0.6 2020-08-17 10:34:50 -04:00
John Mitchell 4cb50e8395 Added image cube array. 2020-08-16 23:10:06 -04:00
Dzmitry Malyshau 44fdfb80d0 Fix support for d24unorm format 2020-08-13 17:26:44 -04:00
Dzmitry Malyshau d8341c5996 Add labels to pipelines 2020-08-13 12:14:24 -04: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
Dzmitry Malyshau 1f5622a0b3 Respect texture view aspect on creation 2020-08-10 16:14:20 -04: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
Dzmitry Malyshau 8731da278e Streghten the multi-ref-count on BGLs 2020-08-05 17:39:25 -04:00
Kunal Mohan aa44969818 Replace u32 with NonZeroU32 in TextureView 2020-08-05 21:23:25 +05:30
Gabriel Majeri 021251a908 Remove power module 2020-08-05 16:27:41 +03:00
Dzmitry Malyshau dbd7e2c579 Separate valid internal IDs from external ones 2020-08-04 11:16:59 -04:00
Dzmitry Malyshau 3291b72368 Update naga and fix type widths 2020-07-31 23:46:19 -04:00
Connor Fitzgerald 00a5be7f7b Fix multi-layer copies 2020-07-30 16:58:29 -04:00
Kunal Mohan c8360152cd Replace NonZeroU32 with u32 in TextureViewDescriptor 2020-07-30 21:35:07 +05:30
Connor Fitzgerald e5c647745e Implement TEXTURE_COMPRESSION_BC extension 2020-07-29 18:43:50 -04:00
bors[bot]andGabriel Majeri f6ba5b8298 Merge #845
845: Finish error model refactor r=kvark a=GabrielMajeri

**Connections**
I think this is the last part of #638. I've reviewed all the remaining `unwrap`s and `assert`s in the code, and these should be the last ones left which ought to return errors (the remaining ones seem to uphold internal invariants).

**Description**
Implements error handling for various conditions, which are then returned to the caller. Including, but not limited to:
- running out of memory when creating a command pool
- running out of memory when creating a frame buffer for a render pass
- invalid dimensions when creating a texture

**Testing**
Tested with core and player.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-29 18:10:33 +00:00
Gabriel Majeri a5f72d26d3 Handle DeviceLost in triage_submissions 2020-07-29 20:17:48 +03:00
Gabriel Majeri 62f1f9c438 Error types for conv module 2020-07-29 20:17:46 +03:00
Kunal Mohan 0ef76a7643 Add mip level count and array layer count validation to texture_create_view 2020-07-29 21:47:28 +05:30