Commit Graph
8323 Commits
Author SHA1 Message Date
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
Jim Blandy 6701e2bf96 Avoid non-exhaustive matches on Expression.
Non-exhaustive matches on `Expression` make it harder to review changes that add
new enum variants, because the compiler can't tell you that you've missed a
case.

Although I believe Clippy is able to do so, I don't think we should make a
blanket rule of forbidding wildcard match arms against `Expression`. There are a
few matches that are only concerned with a handful of variants, or a single
variant. For example, variant, naga::front::spv::Parser::next_block is only
concerned with whether an expression is a constant or not. In principle, these
sites should also be checked when adding a new variant, but it seems too
burdensome to require them to list all the `Expression` variants they don't care
about. The principle should be applied only to matches that are already handling
most variants.

At the moment, there is only one such match on `Expression` in the code base,
and it's only missing a few variants, so this is quick to fix.
2021-04-14 16:11:37 -04:00
Dzmitry Malyshau c2c93e4ecd Remove cargo-insta 2021-04-14 16:10:31 -04: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
Jim Blandy f7fdf6b560 Makefile: Be more flexible in removing YAML headers from snapshots.
The snapshot files in tests/out start with headers like this:

    ---
    source: tests/snapshots.rs
    expression: dis
    ---
    ; SPIR-V
    ; Version: 1.0
    ; Generator: rspirv
    ...

The Makefile's `validate-foo` targets trim off those lines with `tail -n +5`
before submitting their test to the validators.

However, some versions of the `insta` crate seem to generate headers with an
extra blank line, like this:

    ---
    source: tests/snapshots.rs
    expression: dis

    ---

This makes the `validate-foo` targets unhappy.

This commit changes the `validate-foo` targets to use `sed` to cope with both
kinds of headers.
2021-04-13 23:43:55 -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
Dzmitry Malyshau 3f57e4db5a Enable texture-array snapshot on Metal 2021-04-13 01:31:57 -04:00
Dzmitry Malyshau 2923cfb3aa [spv-in] claim Vulkan Memory Model support 2021-04-13 01:31:57 -04:00
Dzmitry Malyshau 270feb3c0f [msl] map push constants to buffers 2021-04-13 01:31:57 -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
Aaron Housh c820cc8e73 Add Map Alignment type (#1322)
* Add Map Alignment type

* Fix clippy warnings

* Make buffer_map_async compare range start to MAP_ALIGNMENT
2021-04-12 13:28:46 -04:00
Dzmitry Malyshau 9cd2b04c04 [spv-out] put matrix decorations on arrays of matrices (#712) 2021-04-12 12:12:19 -04:00
Ashley 202d3a6912 Add metal constants to keywords (#709) 2021-04-11 14:36:29 -04:00
Ashley 640bfb1f26 [Metal] Make constant composites non-constexpr (#707)
* Make constant composites non-constexpr

* Update shadow test
2021-04-11 14:21:47 -04:00
Ashley 98db1dedcd Add a note about references and pointers to Expression::Load (#708)
* Add a note about references and pointers to Expression::Load

* Formatting

* Remove comma

* Clearer English
2021-04-11 14:21:02 -04:00
Ashley 3b4acc5300 [Metal] Handle length(float) and distance(float, float) (#706)
* Handle length(float x)

* Handle length(float) and distance(float, float)

* Apply suggestions

* Apply suggestions

* Move stack size range up by 1000
2021-04-11 13:01:31 -04:00
Ashley 30180c008b [Metal] Change the function argument pointer type to use & instead of * (#693)
* Take references in function calls if thats what the funciton wants

* Use references instead of pointers the function argument list
2021-04-11 12:48:22 -04:00
Ashley 9549b26a90 Add the reserved types in metal_types to metal keywords (#705) 2021-04-11 12:32:01 -04:00
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