Commit Graph

13 Commits

Author SHA1 Message Date
wicast
25e4f17a69
add debug info for spv-out (#2379) 2023-06-28 14:30:25 +02:00
teoxoy
cc3a8ac737 add Capabilities::MULTISAMPLED_SHADING 2023-02-16 18:16:49 -05:00
Shaye Garg
67ea8f0c06
[wgsl-in] Split into multiple files (#2207)
Make changes suggested in #2075, but put off to a separate PR because they would interfere with reviewing the change:

- Split the new WGSL front end into modules in a logical way.
- Rename `Parser` to `Frontend`.
2023-01-31 07:17:58 -08:00
Jim Blandy
26dca556a9 Allow clippy::needless_borrowed_reference.
In Clippy 1.67, the `needless_borrowed_reference` lint [was enhanced]
to look into struct and tuple patterns, so that a line like this:

    for &(ref module, ref info) in inputs.iter()

where `inputs.iter()` is yielding `&(Module, ModuleInfo)` pairs,
elicits a warning. Clippy suggests, instead:

    for (module, info) in inputs.iter()

but this is at odds with Naga's preference that `match` patterns
should have the same type as the expression being matched, for which
we have enabled the `pattern_type_mismatch` lint since
9e5cc4c9 (2021-3-12).

[was enhanced]: https://github.com/rust-lang/rust-clippy/pull/9855
2023-01-31 11:27:51 +01:00
teoxoy
c7d02151f0 add support for zero-initializing workgroup memory 2023-01-25 18:07:48 +01:00
Erich Gubler
21c7092762
Satisfy latest clippy lints (up to Rust 1.64) (#2081)
* refactor: satisfy `clippy::borrow_deref_ref`

* chore: satisfy `clippy::ptr_arg`

* refactor: satisfy `clippy::needless_update`

* chore: `allow(clippy::too_many_arguments)` on `write_output_glsl` test

Since this is test code, I don't think there's a strong impetus to refactor types to consolidate
or otherwise alter arguments here. Let's just `allow` this.

* refactor: satisfy `clippy::single_match`

I think it's sixes whether to keep this code as-is or to `allow(...)` as-is. 🤷🏻‍♂️

* refactor: satisfy `clippy::single_char_pattern`

* refactor: satisfy `clippy::reversed_empty_ranges`

The lint fires because it generally doesn't make sense to use a `Range` built this way; [upstream
`Range` docs]) states:

> It is empty if `start >= end`.

`clippy` wants to help us from naively iterating over a `Range` like this! Thanks, `clippy`!
However, we're not actually using the offending `addresses` variables for iteration. We're using
them as a flat data structure with fields that happen to conceptually match. We can, therefore,
sidestep this lint by "just" inlining into separate variables for start and end instead.

[upstream `Range` docs]: https://doc.rust-lang.org/stable/std/ops/struct.Range.html

* refactor: satisfy `clippy::pattern_type_mismatch`

* chore: `allow(clippy::panic)` for `test`

We definitely should let `panic!(...)` calls exist in `cfg(test)`! It's a very standard way to fail
`#[test]` functions. It seems that previous test authors agree! 😅

* fixup! refactor: satisfy `clippy::pattern_type_mismatch`

* fixup! refactor: satisfy `clippy::single_match`
2022-11-03 09:32:15 -07:00
Ashley
e2d688088a
Support for the OVR_multiview2 WebGL extension (#1933)
* Make some (currently hacky) changes to enable multiview in webgl

* Fix ViewIndex built in for this extension

* Run cargo fmt, fix tests

* Allow specifying if we're targetting webgl in the glsl version

* Document multiview2 extension

* fn embedded -> const fn embedded

* Fix tests

* Fix benches

* Add snapshot tests

* Revamp so that the glsl options have some multiview options. Also add tests

* Make clippy happier

* Go back to having is_webgl be part of Version

* Use wgsl as input for tests

* Rename Version::new_embedded to Version::new_gles, fix glsl validation

* Run cargo fmt

* Fix brand new clippy warnings
2022-06-30 17:58:47 +01:00
Jim Blandy
231341f056 Fix Criterion benchmark build.
As of #1889, the GLSL back end takes an additional argument specifying
the bounds checks policies to use.
2022-06-01 08:18:46 -07:00
Dzmitry Malyshau
8fd8e7d575 Address Jim's notes 2022-02-17 09:49:33 -05:00
Dzmitry Malyshau
c524a6beac bench: backends 2022-02-17 09:49:33 -05:00
Dzmitry Malyshau
14b4a686c6 bench: validation 2022-02-17 09:49:33 -05:00
Dzmitry Malyshau
5879f9ea73 bench: glsl, spirv, and bincode inputs 2022-02-17 09:49:33 -05:00
Dzmitry Malyshau
b05f648842 bench: WGSL parsing 2022-02-17 09:49:33 -05:00