Commit Graph
3491 Commits
Author SHA1 Message Date
Pâris DOUADY 8b79b056fa [rs] Fix initializing buffer with unaligned data
In wgpu 0.7, this was a valid operation, the zero padding was done by hand. 
However in #872 this was removed as an optimization since buffers are zero padded, however the slice end was taken from buffer.slice which has to be aligned when mapped.
2021-05-07 13:50:49 +02:00
Luca Casonato 751aa714f4 fix: zeroable buffer_get_mapped_range size
According to spec, size can be Some(0).
2021-05-06 22:03:43 -04:00
Dzmitry Malyshau 8895e28836 Integrate codecov.io on CI 2021-05-06 13:29:14 -04:00
Dzmitry Malyshau 3bd0e8b050 Validate storage class 2021-05-06 13:25:34 -04:00
Dzmitry Malyshau de5907d938 Explicitly list output spirv capabilities 2021-05-06 13:25:21 -04:00
bors[bot]andImbris 6d5b46b6d1 [rs] Merge #894
894: Skip mapping of zero sized buffers in create_buffer_init to avoid a panic and avoid creating an unused padded buffer r=kvark a=Imberflur



Co-authored-by: Imbris <imbrisf@gmail.com>
2021-05-04 02:34:56 +00:00
Imbris bbc5ba3050 [rs] Skip mapping of zero sized buffers in create_buffer_init to avoid a panic and avoid creating an unused padded buffer 2021-05-03 22:22:49 -04:00
Dzmitry Malyshau 79fcfaa11a Custom PPA for lavapipe. (#1365)
Don't run CI on non-master branches.
2021-05-03 21:46:01 -04:00
bors[bot]andDzmitry Malyshau e83e4ff501 [rs] Merge #880
880: Remove profiling dependency, bump version to 0.8 r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1355 and removes profiling markers from wgpu-rs. They don't show anything extra on top of wgpu-core markers, see https://github.com/gfx-rs/wgpu-rs/discussions/879

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 16:37:01 +00:00
Dzmitry Malyshau b73887f17e [rs] Version bump to 0.8 2021-04-29 12:30:29 -04:00
Dzmitry Malyshau 3467c3a676 [rs] Remove profiling dependency 2021-04-29 12:30:29 -04:00
bors[bot]andChandler Newman 85a1480959 [rs] Merge #850
850: Add uniform and storage buffer arrays r=kvark a=csnewman

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

**Description**
Adds uniform and storage buffer arrays

Usage:
```
wgpu::BindGroupEntry {
    binding: 0,
    resource: BindingResource::BufferArray(&[
        buffer1.as_entire_buffer_binding(),
        buffer2.as_entire_buffer_binding(),
    ]),
}
```



Co-authored-by: Chandler Newman <chandler2newman@hotmail.co.uk>
2021-04-29 16:18:52 +00:00
Chandler Newman a267d0785d [rs] Add uniform and storage buffer arrays 2021-04-29 12:17:37 -04:00
Dzmitry Malyshau e5ddb94be0 Version bump to 0.8 2021-04-29 11:57:22 -04:00
bors[bot]andDzmitry Malyshau faf3cbc2e9 Merge #1357
1357: Changelog for 0.8 r=kvark a=kvark

Fixes #1265
Closes #1312
Related to https://github.com/gfx-rs/naga/pull/796 and https://github.com/gfx-rs/gfx/pull/3739

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 15:43:35 +00:00
Dzmitry Malyshau ffd47fbc0e Remove Vulkan Portability support 2021-04-29 11:42:26 -04:00
Dzmitry Malyshau 6f9c254061 Changelog for 0.8 2021-04-29 11:33:17 -04:00
bors[bot]andDzmitry Malyshau c539c1f4ab Merge #1358
1358: Big refactor of the profiling usage r=kvark a=kvark

**Connections**

**Description**
Improves the profiling markers in many ways:
  1. remove unnecessary leftovers from the `tracing` era, such as querying device/adapter features. These are one-time and light-weight. It's unlikely we are going to be interested in them.
  2. add markers to where it really matters, such as `maintain` pieces, `submit` phases, render pass preparation, etc.
  3. shorten the markers to be strictly the function names, passing the class name as a tag

**Testing**
Tested on vange-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-29 06:08:14 +00:00
Dzmitry Malyshau 6ff618aafb Big refactor of the profiling usage 2021-04-29 02:06:58 -04:00
bors[bot]andChandler Newman acd21eeeb1 Merge #1315
1315: Add buffer arrays r=kvark a=csnewman

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

**Description**
Adds buffer array bindings

**Testing**
TODO
<!--
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: Chandler Newman <chandler2newman@hotmail.co.uk>
2021-04-29 04:40:54 +00:00
Chandler Newman 904ec7a5ee Add uniform and storage buffer arrays 2021-04-29 00:38:04 -04:00
bors[bot]andDzmitry Malyshau c727b1a7f5 Merge #1355
1355: Add shader compile markers r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3736 and prior PRs

**Description**
Allows clearly seeing the times spent in shader translation code.

**Testing**
Tested on vange-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-27 16:24:37 +00:00
Dzmitry Malyshau 087bd07f55 Add shader compile markers 2021-04-27 12:23:28 -04:00
bors[bot]andDzmitry Malyshau e1a56042c0 [rs] Merge #878
878: Update naga to gfx-23 r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1353 and https://github.com/gfx-rs/wgpu/pull/1354

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 16:17:09 +00:00
Dzmitry Malyshau 07a876c8d5 [rs] Update naga to gfx-23 2021-04-26 12:16:01 -04:00
bors[bot]andDzmitry Malyshau 13015c8621 Merge #1354
1354: Update profiling to 1.0 r=kvark a=kvark

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

**Description**
Some crates like to release 1.0

**Testing**
Should work

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 16:00:46 +00:00
Dzmitry Malyshau 6c7f2b917f Update profiling to 1.0 2021-04-26 11:59:15 -04:00
bors[bot]andDzmitry Malyshau ba1b2c5f19 Merge #1353
1353: Update naga to gfx-23 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3733

**Description**
Just a bunch of Naga fixes

**Testing**
To be tested in wgpu-rs

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-26 15:21:41 +00:00
Dzmitry Malyshau 03c4e0969e Update naga to gfx-23 2021-04-26 11:10:22 -04:00
bors[bot]anddzil123 cd7ba87a2c [rs] Merge #876
876: Derive Default for PipelineLayoutDescriptor r=kvark a=dzil123



Co-authored-by: dzil123 <5725958+dzil123@users.noreply.github.com>
2021-04-23 17:28:06 +00:00
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