Commit Graph
8897 Commits
Author SHA1 Message Date
Timo de Kort 5d487941b2 Start hlsl-out (#408)
* Add hlsl-out feature

* Integrate hlsl-out with snapshots

* Add snapshot
2021-04-11 11:36:26 -04:00
Ashley a8f1022b12 [Metal] Handle NaN and inf correctly in constants (#704)
* Handle NaN and inf

* Handle negative infinity
2021-04-11 11:06:23 -04:00
bors[bot]andDzmitry Malyshau fc59ea4aba [rs] Merge #851
851: Update naga to gfx-21 r=kvark a=kvark

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

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-11 05:26:26 +00:00
Dzmitry Malyshau 9bd4b34d5a [rs] Update naga to gfx-21 2021-04-11 01:25:42 -04:00
Mehmet Oguz Derin 142038c85b WGSL: const to let 2021-04-11 01:24:19 -04:00
bors[bot]andDzmitry Malyshau 27dbf076d5 Merge #1320
1320: Update naga to gfx-21 r=kvark a=kvark

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

**Description**
Brings a number of Naga fixes.

**Testing**
wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-11 05:17:07 +00:00
Dzmitry Malyshau 1ba95585ba Update naga to gfx-21 2021-04-11 01:07:46 -04:00
Simas Toleikis 98252cf5d2 Fix validation for textureDimensions(t) call. 2021-04-10 18:19:42 -04:00
Ashley Ruglys 1fc88319e8 Serialize mtl EntryPointError 2021-04-09 19:57:12 -04:00
Matúš Talčík 44a6c02cda spv-in: special-case a loop with true/false node == merge node
beautify

beautify #2
2021-04-09 17:17:02 -04:00
Dzmitry Malyshau 67e3e0a697 [spv-in] work around row-major matrices 2021-04-09 11:22:13 -04:00
Dzmitry Malyshau 0cc22c8c65 [spv-in] move the matrix decoration handling to structure parsing 2021-04-09 11:22:13 -04:00
Dzmitry Malyshau 425c75eb3f [msl-out] emit packed vectors if necessary 2021-04-09 00:48:18 -04:00
Dzmitry Malyshau f3ba6e91c2 [msl-out] shorten the expression name 2021-04-09 00:48:18 -04:00
Dzmitry Malyshau 4ff5fa4568 [msl-out] add support for matrix value types 2021-04-09 00:48:18 -04:00
bors[bot]andDzmitry Malyshau 4c61a910fc Merge #1313
1313: Don't panic on change_extend errors r=cwfitzgerald a=kvark

**Connections**
???

**Description**
We used to have leftover `unwrap()` for extending the usages of render targets.
Now these are all routed via `UsageConflicts` into actual errors.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-09 04:36:49 +00:00
Dzmitry Malyshau 604e10e19b Rewrite IR to have member offsets, full structure span and alignment 2021-04-08 23:15:03 -04:00
Dzmitry Malyshau 7326ba6ddb New struct layout IR 2021-04-08 23:15:03 -04:00
bors[bot]andRichard Tjerngren b47b77798b [rs] Merge #847
847: Don't pin web-sys and wasm-bindgen versions r=grovesNL a=RichoDemus

Pinning them forces all downstream dependencies to use exactly this version

The latest release of wgpu has pinned an old version of wasm-bindgen, forcing users to downgrade wasm-bindgen-cli in order to build

Co-authored-by: Richard Tjerngren <git@richodemus.com>
Co-authored-by: RichoDemus <git@richodemus.com>
2021-04-09 02:22:20 +00:00
Jim Blandy 5a0e3ad5ff [spv-out]: Add some local use declarations to the SPIR-V writer.
This adds `use` declarations for `spirv::Decoration` and `spirv::BuiltIn` local
to functions where those are used repeatedly.
2021-04-08 20:27:48 -04:00
LaughingMan d0d9e09cdb [spv-in] Copy less bytes in parse_function
The initial intention was to make the code a little more elegant and match on
the Vec itself instead of its length, however there's also a - probably
minuscule - performance advantage:

`Vec::remove` internally copies the removed element onto the stack. In this case
that's a `StructMember` weighting 48 bytes. The `Binding` we are actually
interested in is only 8 bytes tough.

Cloning just the `Binding` saves us from copying 40 bytes for nothing.
2021-04-08 13:10:56 -04:00
Dzmitry Malyshau 6166b95b6a [msl] inline some of the constants 2021-04-08 12:36:43 -04:00
Dzmitry Malyshau 191f33871b Don't panic on change_extend errors 2021-04-08 12:03:46 -04:00
Dzmitry Malyshau 2774dcb403 [msl] inline some of the types 2021-04-08 11:10:52 -04:00
Dzmitry Malyshau f1c5e04b89 [msl] fix select() arguments 2021-04-08 11:10:52 -04:00
Dzmitry Malyshau e06451777e [msl] address review comments, rename SubOptions to PipelineOptions, add more inlined states 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau 499f2e3cbe [msl] add a snapshot test for inline sampler 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau 7c11759041 Re-use the MSL types in snapshot code 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau 9e09c792dc [msl] write down inline samplers 2021-04-07 22:49:13 -04:00
Dzmitry Malyshau dcbedd17d0 [msl] basic infrastructure for inline samplers
Also move out "allow_point_size" into SubOptions to allow
main Options to not be cloned.
2021-04-07 22:49:13 -04:00
Jim Blandy 2da7477322 [wgsl-in] Decorations are now called attributes. (#671)
Renames:

Error::UnknownDecoration => Error::UnknownAttribute
TypeDecoration => TypeAttributes
Scope::Decoration => Scope::Attribute

various argument names, string literals, comments
2021-04-07 22:45:38 -04:00
Zakarum ccb6dc9088 Panic to prevent arena Handle overflow (#667)
* Panic to prevent arena Handle overflow

* Use `NonZeroU32::new` to detect overflow
2021-04-07 14:00:40 -04:00
RichoDemus 46d4492b54 [rs] Use latest version of wasm-bindgen-cli 2021-04-07 18:21:26 +02:00
Richard Tjerngren 244460ed87 [rs] Don't pin web-sys and wasm-bindgen versions
Pinning them forces all downstream dependencies to use exactly this version

The latest release of wgpu has pinned an old version of wasm-bindgen, forcing users to downgrade wasm-bindgen-cli in order to build
2021-04-07 16:06:03 +02:00
bors[bot]andDzmitry Malyshau ff5e626bfd Merge #1311
1311: Update gfx with the cmd buf freeing fix r=kvark a=kvark

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

**Description**
just an update

**Testing**
nopes

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-06 14:29:47 +00:00
Dzmitry Malyshau 02442bcb5e Update gfx with the cmd buf freeing fix 2021-04-06 10:28:51 -04:00
bors[bot]andDzmitry Malyshau a8fc4a3d84 [rs] Merge #845
845: Update wgpu with depth clamping API changes r=kvark a=kvark

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

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-06 13:40:10 +00:00
bors[bot]andFranz 111bb5bec6 Merge #1310
1310: Updated `gpu-alloc` to rev 2cd1ad6 r=kvark a=francesco-cattoglio

**Connections**
Updated gpu-alloc to include the commit that fixed https://github.com/zakarumych/gpu-alloc/issues/41

**Description**
It is a simple update of a dependency.

**Testing**
I have not tested this change, I just made sure that everything was still compiling correctly.
<!--
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: Franz <francesco.cattoglio@gmail.com>
2021-04-06 13:27:07 +00:00
Franz 7a37f07ea0 Updated gpu-alloc to rev 2cd1ad6 2021-04-06 11:16:49 +02:00
Dzmitry Malyshau 756ea0e51f [rs] Update wgpu with depth clamping API changes 2021-04-05 23:27:53 -04:00
bors[bot]andDzmitry Malyshau e430cf4bcc Merge #1309
1309: Move depth clamping to primitive state r=kvark a=kvark

**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1583

**Description**
There are valid cases where we'd want the depth clamping happening without any depth/stencil attachment or state.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-05 20:02:40 +00:00
Dzmitry Malyshau 4d324bc38d Move depth clamping to primitive state 2021-04-05 16:01:23 -04:00
bors[bot]andDzmitry Malyshau 2448307a25 [rs] Merge #844
844: Update wgpu to the cross feature fix r=kvark a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-05 05:13:48 +00:00
Dzmitry Malyshau 4c6bce87d8 [rs] Update wgpu to the cross feature fix 2021-04-05 01:13:13 -04:00
bors[bot]andDzmitry Malyshau eef478fc5d Merge #1307
1307: Update gfx with fixed Metal cross feature r=kvark a=kvark

Just another update

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-05 04:48:59 +00:00
Dzmitry Malyshau 2e9d9d8267 Update gfx with fixed Metal cross feature 2021-04-05 00:48:17 -04:00
bors[bot]andDzmitry Malyshau a474992b72 [rs] Merge #843
843: Update wgpu-core with SPIRV coordinate fix r=kvark a=kvark

See https://github.com/gfx-rs/wgpu/pull/1305
Fixes #842

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-04 23:08:31 +00:00
Dzmitry Malyshau 88524d2ff8 [rs] Update wgpu-core with SPIRV coordinate fix 2021-04-04 19:08:03 -04:00
bors[bot]andDzmitry Malyshau 31f52202c5 Merge #1305
1305: Don't flip SPIR-V coordinate space on input r=kvark a=kvark

**Connections**
fixes https://github.com/gfx-rs/wgpu-rs/issues/842

**Description**
The SPV-in by default changes the coordinate space, but for WebGPU we don't want it.

**Testing**
Untested...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-04 22:42:24 +00:00
Dzmitry Malyshau 1dddfa6234 Don't flip SPIR-V coordinate space on input 2021-04-04 18:38:56 -04:00