Commit Graph
2761 Commits
Author SHA1 Message Date
dzil123 360c3b3352 [rs] Derive Default for PipelineLayoutDescriptor 2021-04-23 03:49:36 -07:00
bors[bot]andDzmitry Malyshau adfa1245d8 Merge #1351
1351: Hard error on SPIRV parsing failure when VALIDATION is requested r=cwfitzgerald a=kvark

**Connections**
Follow-up from https://github.com/gfx-rs/wgpu/issues/1350#issuecomment-825186159

**Description**
If the user provided SPIR-V, and they requested VALIDATION, and we fail to parse the file - there is no point to proceed.
VALIDATION flag should be a gaurantee of safe operation, so we can't just throw the same SPIR-V at SPIRV-Cross and pretend that it's ok.

**Testing**
Tested on noclip shaders

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-04-22 23:21:39 +00:00
Dzmitry Malyshau 525efda7b2 Hard error on SPIRV parsing failure when VALIDATION is requested 2021-04-22 17:18:16 -04:00
bors[bot]andDiggory Hardy 7058299954 [rs] Merge #873
873: Boids example: cleaner rand code r=kvark a=dhardy

... for a certain definition of cleaner. Is this clearer or just more confusing?

Co-authored-by: Diggory Hardy <git@dhardy.name>
2021-04-22 13:50:05 +00:00
Diggory Hardy 935b06f3dd [rs] Boids example: cleaner rand code 2021-04-22 10:31:10 +01:00
bors[bot]andgrovesNL 704d5d00b6 [rs] Merge #872
872: Remove zero padding from `create_buffer_init` r=kvark a=grovesNL

Follow-up to #870 (https://github.com/gfx-rs/wgpu-rs/pull/870#issuecomment-824333926)

Co-authored-by: grovesNL <josh@joshgroves.com>
2021-04-22 02:20:05 +00:00
grovesNL 73e7553df4 [rs] Remove zero padding from create_buffer_init
The buffer should already be zeroed so zeroing shouldn't be necessary
2021-04-21 23:03:40 -02:30
bors[bot]andDzmitry Malyshau fe07d272b1 Merge #1348
1348: Change error type for the backend shader r=kvark a=kvark

**Connections**
Fixes #1347

**Description**
Issues a better error for this case

**Testing**
Should work

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-21 21:07:49 +00:00
Dzmitry Malyshau bc4c5c8f03 Change error type for the backend shader 2021-04-21 17:06:58 -04:00
bors[bot]andDiggory Hardy 64ac552a9a [rs] Merge #870
870: Remove dead code r=kvark a=dhardy

Also, why bother setting the padding bytes to 0?

Co-authored-by: Diggory Hardy <git@dhardy.name>
2021-04-21 18:04:32 +00:00
Diggory Hardy d14d3b5cbd [rs] Remove dead code 2021-04-21 17:26:36 +01:00
bors[bot]andDzmitry Malyshau 43798a502f Merge #1346
1346: Make implicit ids actually errors to start with r=kvark a=kvark

**Connections**
Follow-up to #1341

**Description**
Turns out, leaving the indices `Vacant` is also not an option, since the `hub.rs` code considers this an internal error (unexpected), and panics.

**Testing**
Tested on Austin's examples in Gecko

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-04-20 21:35:12 +00:00
Dzmitry Malyshau 8505a39f6a Make implicit ids actually errors to start with 2021-04-20 17:32:40 -04:00
bors[bot]andDzmitry Malyshau 8704a6e3b5 Merge #1342
1342: Update gfx to the new image view API r=kvark a=kvark

**Connections**
Grabs https://github.com/gfx-rs/gfx/pull/3725 and https://github.com/gfx-rs/gfx/pull/3726
Addresses https://github.com/gfx-rs/wgpu-rs/discussions/868#discussioncomment-633648

**Description**
Updates gfx, also improves the error messages for pipeline creation a bit.

**Testing**
Not really, this is low-risk.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-20 15:11:07 +00:00
Dzmitry Malyshau cc2e547d48 Update gfx to the new image view API 2021-04-20 10:16:30 -04:00
bors[bot]andDzmitry Malyshau 9c47ae6183 Merge #1332
1332: Validate min/max blending factors r=kvark a=kvark

**Connections**
Based on #1325 
Matches https://github.com/gpuweb/gpuweb/pull/1635

**Description**
This PR refactors the color state errors, giving them more detailed context, and having a dedicated enum for them.
It also adds the check for the blend factors to be (1, 1) for the min/max operations.

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-20 13:37:39 +00:00
Dzmitry Malyshau cac643507b Validate min/max blending factors 2021-04-20 09:37:07 -04:00
bors[bot]andDzmitry Malyshau 8239307bcb Merge #1341
1341: Mark unused implicit BGL ids as vacant r=kvark a=kvark

**Connections**
Fixes https://github.com/gfx-rs/wgpu/issues/1340

**Description**
This is not an ideal solution. We aren't marking the IDs as errors. But it's an improvement, and it resolves the crash in FF, supposedly.

**Testing**
Tested on wgpu-rs examples with implicit layouts

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-20 03:42:28 +00:00
Dzmitry Malyshau de86f2a72f Mark unused implicit BGL ids as vacant 2021-04-19 23:35:33 -04:00
bors[bot]andDzmitry Malyshau 5d30d910a0 [rs] Merge #866
866: Update gfx and naga to gfx-22 r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1339

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-19 22:15:51 +00:00
Dzmitry Malyshau 1ada1d8d24 [rs] Update gfx and naga to gfx-22 2021-04-19 18:15:14 -04:00
bors[bot]andDzmitry Malyshau 523ef2dfec Merge #1339
1339: Update naga to gfx-22, add interpolation sampling validation r=kvark a=kvark

**Connections**
Includes https://github.com/gfx-rs/gfx/pull/3729, https://github.com/gfx-rs/gfx/pull/3719, https://github.com/gfx-rs/naga/pull/689, https://github.com/gfx-rs/naga/pull/700, and other fixes

**Description**
Update gfx and naga to latest (gfx-22 tag).
The hope is for this to be the last tag release before 0.8

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-19 17:40:24 +00:00
Dzmitry Malyshau 27f51ca252 Update naga to gfx-22, add interpolation sampling validation 2021-04-19 13:33:36 -04:00
bors[bot]andDzmitry Malyshau b500fa86f1 Merge #1331
1331: Validate filtering r=cwfitzgerald a=kvark

**Connections**
See https://github.com/gpuweb/gpuweb/pull/1223

**Description**
This PR implements validation of sampler filtering (property in BGL), as well as the ability to filter non-filterable textures.

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-18 14:26:31 +00:00
Dzmitry Malyshau 280ba30c6c Don't compare booleans 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau 92886b4995 Validate filtering samplers at BG creation 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau 6d7ef8b8fd Validate filtered sampling 2021-04-18 10:25:54 -04:00
bors[bot]andDzmitry Malyshau a749f09bbf Merge #1325
1325: Relax and imporve vertex attribute validation r=cwfitzgerald a=kvark

**Connections**
None

**Description**
Improves our validation of vertex attributes in the following ways:
  1. Relaxes the size matching, so that we allow the shaders to default some of the values we don't provide
  2. Require interpolation to match
  3. Make the error messages more detailed:

>     In Device::create_render_pipeline
    error in stage VERTEX
    error matching the stage input at 1 (Uint32x2 interpolated as None) against the previous stage outputs
    input type is not compatible with the provided Float32x2

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

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-18 07:37:54 +00:00
bors[bot]andadamnemecek 8bd1ccb351 [rs] Merge #860
860: Drops the Sync requirement from UncapturedErrorHandler r=kvark a=adamnemecek



Co-authored-by: adamnemecek <adamnemecek@gmail.com>
2021-04-15 21:12:49 +00:00
bors[bot]andIgor Shaposhnik baf477ba10 [rs] Merge #861
861: Remove glslangvalidator requirements from water example r=kvark a=Gordon-F

`glslangvalidator` is no longer needed because the example uses WGSL.

Co-authored-by: Igor Shaposhnik <Gordon-F@users.noreply.github.com>
2021-04-15 20:57:15 +00:00
Igor Shaposhnik fa86dd542c [rs] Remove glslangvalidator requirements from water example 2021-04-15 23:14:25 +03:00
adamnemecek e9aa015a96 [rs] Drops the Sync requrement from UncapturedErrorHandler 2021-04-15 11:57:19 -07:00
bors[bot]andashpil 6d08986874 [rs] Merge #859
859: Fix typos - it's -> its r=cwfitzgerald a=ashpil

As I was reading the documentation, I found an instance where "it's" should actually be "its", as it is used as a possessive, not a contraction. I fixed that and `grep`ed for other instances, of which I found one and fixed as well.

Co-authored-by: ashpil <shpilenok2001@gmail.com>
2021-04-15 16:49:12 +00:00
ashpil c4fdcbc190 [rs] Fix typos it's -> its 2021-04-15 12:39:16 -04:00
bors[bot]andDzmitry Malyshau 9f812f3884 [rs] Merge #858
858: Update blend APIs r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1333

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-15 15:49:11 +00:00
Dzmitry Malyshau b14215f468 [rs] Update blend APIs 2021-04-15 11:48:42 -04:00
bors[bot]andDzmitry Malyshau 6a6a9a4aed Merge #1333
1333: Update blending API names r=kvark a=kvark

**Connections**
Follows https://github.com/gpuweb/gpuweb/pull/1627 and https://github.com/gpuweb/gpuweb/pull/1633

**Description**
Makes the names clearer.

**Testing**
No need

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-15 15:27:26 +00:00
Dzmitry Malyshau c744582052 Update blending API names 2021-04-15 11:25:04 -04:00
bors[bot]andadamnemecek 9c5e0eb5b8 [rs] Merge #857
857: updated wgpu with more copyable types r=kvark a=adamnemecek



Co-authored-by: adamnemecek <adamnemecek@gmail.com>
2021-04-14 20:42:37 +00:00
adamnemecek 9f6bfb2bab [rs] Updated wgpu version 2021-04-14 13:26:26 -07:00
Dzmitry Malyshau c0478c707d Address clippy issues on copying things 2021-04-14 15:23:20 -04:00
bors[bot]andadamnemecek f949643721 Merge #1329
1329: derive copy for DeviceType, BlendComponent, BlendState, PrimitiveStat… r=kvark a=adamnemecek

…e, MultisampleState, DepthBiasState, StencilFaceState, VertexAttribute, ImageDataLayout, BindGroupLayoutEntry, DrawIndirectArgs, DrawIndexedIndirectArgs, DispatchIndirectArgs



Co-authored-by: adamnemecek <adamnemecek@gmail.com>
2021-04-14 19:11:59 +00:00
adamnemecek 687bc81fac derive copy for DeviceType, BlendComponent, BlendState, PrimitiveState, MultisampleState, DepthBiasState, StencilFaceState, VertexAttribute, ImageDataLayout, BindGroupLayoutEntry, DrawIndirectArgs, DrawIndexedIndirectArgs, DispatchIndirectArgs 2021-04-14 12:09:35 -07:00
adamnemecek 6d3a514c43 updated gfx (#1327)
* updated gfx

* use long rev
2021-04-14 14:37:13 -04:00
Dzmitry Malyshau 78652e93f4 Make input stage errors more detailed 2021-04-13 23:01:02 -04:00
Dzmitry Malyshau b7a0410e09 Relax vertex attribute matching, also check interpolation 2021-04-13 22:19:44 -04:00
Ashley ff75948848 Allow non-storage textures to be able to be queried in validation (#1324)
* Improve the WrongUsage error and allow textures to use query

* Run cargo fmt

* Further improve the error

* Add more QUERY flags
2021-04-13 10:12:17 -04:00
Aaron Housh ef4b2dd079 [rs] Add map alignment from wgpu-types (#853)
* Add map alignment, and fix staging belt aligning to it instead for validations

* bump wgpu versions
2021-04-13 09:44:59 -04:00
bors[bot]andPatrick LaFontaine 2d5647f6d5 [rs] Merge #855
855: Remove comment about `Vec::remove_item` r=kvark a=Pat-Lafon

Sadly, `Vec::remove_item` was an unstable method that was deprecated and has now been removed.

https://github.com/rust-lang/rust/pull/80972

This pr removes a comment suggesting to use `Vec::remove_item` when it stabilizes.

Co-authored-by: Patrick LaFontaine <32135464+Pat-Lafon@users.noreply.github.com>
2021-04-13 05:23:42 +00:00
Patrick LaFontaine 9b67955046 [rs] Remove comment about Vec::remove_item 2021-04-13 00:01:17 -04:00