Commit Graph
8897 Commits
Author SHA1 Message Date
Pelle Johnsen d26f754853 Add more glsl-new handling of funcs and types (#110) 2020-07-14 08:56:18 -04:00
bors[bot]andGabriel Majeri fc4baa3107 Merge #795
795: Move `RenderPass*AttachmentDescriptor` types into core r=kvark a=GabrielMajeri

**Connections**
Follow up to #791.

**Description**
I had the impression that these two types were already shared between `wgpu-core` and `wgpu-rs`, considering they were generic. Further investigation reveals that not to be the case.

This PR moves these types into `wgpu-core`, since they're specific to this crate.

**Testing**
Checked with core, player and `wgpu-rs`.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-14 12:52:27 +00:00
Gabriel Majeri 1b03fbe9be Safe error handling for commands API 2020-07-14 11:40:54 +03:00
Gabriel Majeri 39ed7a008c Move RenderPass*AttachmentDescriptor types into core 2020-07-14 08:11:20 +03:00
bors[bot]andConnor Fitzgerald ee69f3c457 [rs] Merge #435
435: Implement PUSH_CONSTANTS feature r=kvark a=cwfitzgerald

The rust half of the push constant extensions, continuing from https://github.com/gfx-rs/wgpu/pull/777.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-13 19:44:51 +00:00
Connor Fitzgerald 857955483a [rs] Implement PUSH_CONSTANTS feature 2020-07-13 15:43:46 -04:00
bors[bot]andGabriel Majeri 1066173a67 [rs] Merge #437
437: Use common types from `wgpu-types` r=kvark a=GabrielMajeri

The `wgpu-rs` counterpart to https://github.com/gfx-rs/wgpu/pull/791

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-13 17:41:27 +00:00
Pelle Johnsen 244c587457 Glsl new handle version (#109)
* Fix TokenMetadata for #version

* Add glsl-new #version parsing

* Fix clippy issues

* glsl-new only core profile, allow 440-460

* Cleanup glsl-new profile matching
2020-07-13 13:40:12 -04:00
Gabriel Majeri f41e9ea5e2 [rs] Use common types from wgpu-types 2020-07-13 20:12:27 +03:00
bors[bot]andConnor Fitzgerald f67771fb87 Merge #777
777: Implement PUSH_CONSTANTS feature r=kvark a=cwfitzgerald

**Connections**

Closes #734. Makes minor progress on #689.

**Description**

This one is a doozy.

Implements Push Constant support in wgpu.

Implementation Notes:
- Push constants are unconditionally cleared on change to a pipeline with a different pipeline layout. This could be elided in a future revision, possibly making push constants slightly faster on non-vulkan platforms.
- This exposes basically a direct port of vulkan push constants to wgpu. There might be design decisions that would want to be changed for an upstream webgpu implementation.

Code Notes:
- The render bundle code needs to be heavily scrutinized because I wasn't able to test it and it requires pipeline invalidation.
- Validation should be correct as I have tested it pretty throughly, but there are a lot of factors involved, so I could have accidentally missed something (or not allowed something I should have).

Other Work:
- `PipelineLayoutDescriptor` was moved into wgt from wgpu-rs with a generic. 

**Testing**

I have modified the wgpu-rs example to use push constants for its uniform fallback, which is a perfect use case for push constants. I have not tested compute constants, but I expect no issues with them.

https://github.com/gfx-rs/wgpu-rs/pull/435


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-13 16:48:19 +00:00
Connor Fitzgerald c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
bors[bot]andDzmitry Malyshau 2208048a89 Merge #789
789: Panic on using a pending buffer r=kvark a=kvark

**Connections**
Validates the use case of https://github.com/gfx-rs/wgpu-rs/issues/436

**Description**
We didn't detect if a buffer had pending *initial* mapping, previously, on submit.

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-13 15:51:50 +00:00
bors[bot]andGabriel Majeri d7ee89018b Merge #791
791: Unify `wgpu-core` and `wgpu-rs` types r=kvark a=GabrielMajeri

**Connections**
Closes #689.

**Description**
Moves a lot of types from `wgpu-rs` which were duplicated in `wgpu-core` to `wgpu-types`.

**Testing**
Checked with core, player and `wgpu-rs`.

Corresponding `wgpu-rs` PR: https://github.com/gfx-rs/wgpu-rs/pull/437

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-13 15:45:09 +00:00
Gabriel Majeri f3b80f1d8d Unify wgpu-core and wgpu-rs types 2020-07-13 18:39:49 +03:00
bors[bot]andGabriel Majeri bcd4c6c33e [rs] Merge #430
430: Unwrap errors from transfer API r=kvark a=GabrielMajeri

`wgpu-rs` part of https://github.com/gfx-rs/wgpu/pull/773

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-13 14:03:50 +00:00
bors[bot]andDavid Peicho 08c873969c Merge #790
790: core: make DeviceType repr(u8) r=kvark a=DavidPeicho

**Connections**

This PR will make gfx-rs/wgpu-native#43 mergeable.

**Description**

`DeviceType` wasn't made to be used in FFI. The enum is now set to `#[repr(u8)]`.

**Testing**

It's not tested 💯 


Co-authored-by: David Peicho <david.peicho@gmail.com>
2020-07-13 13:55:35 +00:00
Gabriel Majeri c4888c1873 [rs] Unwrap errors from transfer API 2020-07-13 14:13:23 +03:00
David Peicho 257151b9a4 core: make DeviceType repr(u8) 2020-07-13 10:45:47 +01:00
Dzmitry Malyshau b7695ceac3 Panic on using a pending buffer 2020-07-13 00:54:24 -04:00
Dzmitry Malyshau 6fe2225880 [rs] Move out the friends list 2020-07-12 21:08:40 -04:00
bors[bot]andDzmitry Malyshau 8a038ba66e Merge #788
788: Make register methods public again r=kvark a=kvark

Fixup after #783
Should unblock https://github.com/gfx-rs/wgpu-rs/pull/430

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-12 18:41:36 +00:00
Dzmitry Malyshau dd38c7ba03 Make register methods public again 2020-07-12 14:39:38 -04:00
Timo de Kort e55c6b56e2 Fix SPIR-V back-end, width will now be multiplied by 8 (#108) 2020-07-12 14:22:47 -04:00
bors[bot]andGabriel Majeri ea680b964d Merge #787
787: Remove non-exhaustive markers r=kvark a=GabrielMajeri

Based on the previous [discussion](https://github.com/gfx-rs/wgpu/pull/774#issuecomment-657171354), this PR removes the `NonExhaustive` structure and any `#[non_exhaustive]` attribute since it's too early to decide how to ensure forward compatibility.

**Testing**
Checked the `core`, `types` and `player` crates.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-12 18:22:21 +00:00
Gabriel Majeri 9cd3d47ce7 Remove non-exhaustive markers 2020-07-12 19:56:04 +03:00
bors[bot]andDzmitry Malyshau 28a3cdc22b Merge #783
783: Basic use of Error for bind groups r=kvark a=kvark

**Connections**
Follow up to #776 

**Description**
Trying to tidy up a few things and add a public use of `Error` variant

**Testing**
not tested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-12 03:44:36 +00:00
Dzmitry Malyshau 967217f89b Basic use of Error for bind groups 2020-07-11 23:41:43 -04:00
bors[bot]andKunal Mohan 6f48482ef3 Merge #782
782: Add check while trying to remove uninserted Ids r=kvark a=kunalmohan

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_
An attempt to fix #781 
regression from #776 

**Description**
_Describe what problem this is solving, and how it's solved._
When we used `VecMap`, it simply returned `None` for even out of bounds access to the map (We depended on it returning `None`). After #776 , we get a panic. So adding a simple index check before accessing it fixes this issue.

**Testing**
_Explain how this change is tested._
Tested on wgpu-rs examples with the changes in https://github.com/gfx-rs/wgpu-rs/pull/430. All examples run fine except the `cube` which segfaults.
<!--
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-07-11 22:32:33 +00:00
Kunal Mohan 4a116fca38 Add check while removing uninserted Ids 2020-07-12 01:13:34 +05:30
bors[bot]andDzmitry Malyshau bd9167ebbc Merge #779
779: Fix hub insertion r=kvark a=kvark

**Connections**
Fixes #778 
Follow-up to #776

**Description**
Problem was `resize_with` takes new length, not a difference.

**Testing**
Untested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-07-11 14:32:02 +00:00
Dzmitry Malyshau aa5676b1f2 Fix hub insertion 2020-07-11 10:30:26 -04:00
bors[bot]andm4b d4efbee10a [rs] Merge #434
434: recreate swapchain on framework.rs examples on resize, ref #352 r=kvark,cwfitzgerald a=m4b

There still seem to be residual race condition like errors w.r.t. resizing on at least x11, but this does fix the panic on x11.

Co-authored-by: m4b <m4b.github.io@gmail.com>
2020-07-11 14:17:31 +00:00
m4b 5a98c1427f [rs] recreate swapchain on framework.rs examples on resize, ref #352 2020-07-10 21:30:39 -07:00
bors[bot]andGabriel Majeri 7d5082753b Merge #773
773: Error handling for data transfer API r=kvark a=GabrielMajeri

**Connections**
Work on the error model described in #376 

**Description**
Removes assertions from the transfer functions, instead returning a custom error type.

**Testing**
Checked with `player` and `wgpu-rs`: https://github.com/gfx-rs/wgpu-rs/pull/430

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-11 02:28:25 +00:00
bors[bot]andCarter Anderson 118f29fa36 [rs] Merge #433
433: make env_logger a dev dependency r=kvark a=cart

env_logger is only used in examples and adds a good number of dependencies to the build tree that arent needed

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2020-07-11 02:27:02 +00:00
Carter Anderson d28787f1d2 [rs] make env_logger a dev dependency 2020-07-10 12:34:03 -07:00
Gabriel Majeri 98e4f73a10 Error handling for data transfer API 2020-07-10 21:50:22 +03:00
Kunal Mohan 26dcdaae59 Add Error State to Storages (#776)
* Add Error State to Storages
fix #772

* use resize function in insert

* address review comments
2020-07-10 14:29:22 -04:00
Kristoffer Søholm 6c062087fa Initial GLSL constant evaluation implementation (#94)
Adds constant evaluation for addition, and uses it for globals and array
specifiers.
2020-07-09 20:52:13 -04:00
bors[bot]andLachlan Sneff 2cd37d3fda [rs] Merge #428
428: Split render pass docs into multiple sections, divided by feature r=cwfitzgerald a=lachlansneff

This does not affect usage at all.

Here's what the docs look like:

<img width="1012" alt="Screen Shot 2020-07-09 at 11 11 30 AM" src="https://user-images.githubusercontent.com/31360811/87057532-fd974c00-c1d4-11ea-8c7f-913a893bcdef.png">


Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
2020-07-09 19:01:07 +00:00
Lachlan Sneff e5dc716a6f [rs] Split render pass docs into multiple sections, divided by feature 2020-07-09 11:06:09 -04:00
bors[bot]andDzmitry Malyshau 68471acf56 Merge #770
770: Rename bindings to entries r=trivial a=kvark

**Connections**
Upstream https://github.com/gpuweb/gpuweb/pull/611

**Description**
Trivial rename of fields

**Testing**
Needs no test!

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-09 03:43:04 +00:00
Dzmitry Malyshau e693170aef Rename bindings to entries 2020-07-08 23:41:09 -04:00
Pelle Johnsen c9fea37430 Add inital ast for glsl-new (#107)
* Add inital ast for glsl-new

* Fix clippy for glsl-new

Deref instead of cloning
2020-07-08 08:46:31 -04:00
bors[bot]andConnor Fitzgerald d3e204127c Merge #769
769: Implement and Validate all WebGPU Limits r=kvark a=cwfitzgerald

**Connections**

None?

**Description**

This adds all the limits that webgpu has currently. It also validates the values.

The main piece of code here is `BindingTypeMaxCountValidator` and `PerStageBindingTypeCounter` which provides the interface for figuring out the maximum per-stage counts in the pipeline. For each `BindGroupLayout` a `BindingTypeMaxCountValidator`is put together during creation using all of the bindings. Then the `BindingTypeMaxCountValidator`s are combined into a single max. This is then validated against the max limits.

Each commit should be independently testable and are grouped by responsibility.

**Testing**

I modified the wgpu-rs example framework to ask for extremely reduced limits and then tested various examples to verify it properly accepted/rejected based on the actual limit.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-08 03:29:51 +00:00
Connor Fitzgerald 36fa3b81b4 Validate BindGroup based limits 2020-07-07 23:27:42 -04:00
Connor Fitzgerald 1d5d7ddc40 Validate PipelineLayout based limits 2020-07-07 23:26:23 -04:00
bors[bot]andDzmitry Malyshau b288ce0a64 [rs] Merge #426
426: wgpu dependency update with memory fixes r=trivial a=kvark

Fixes #423 (mostly!)

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-07 21:30:21 +00:00
Dzmitry Malyshau 8ffbcadcde [rs] wgpu dependency update with memory fixes 2020-07-07 17:29:03 -04:00
bors[bot]andDzmitry Malyshau 01cf22c25a Merge #768
768: Update gfx-extras for the memory changes r=trivial a=kvark

**Connections**
Helps https://github.com/gfx-rs/wgpu-rs/issues/423 quite a bit
Includes https://github.com/gfx-rs/gfx-extras/pull/24

**Description**
Just an update

**Testing**
wgpu-rs examples, internal fuzzying

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-07-07 20:43:06 +00:00