Commit Graph

9013 Commits

Author SHA1 Message Date
Ali
3c82a4cd5c Added support for MSAA(x2,x8) beyond WEBGPU restrictions for native a… (#3140)
Closes https://github.com/gfx-rs/wgpu/issues/2910
2022-11-09 15:19:05 -05:00
Jinlei Li
04d12baa81 Change get_metal_layer() visiability to pub(crate) 2022-11-08 20:16:32 -08:00
Erich Gubler
08b160c293 style: strip trailing whitespace from ci.yml 2022-11-07 17:36:04 -08:00
Erich Gubler
c04da7adae style: strip trailing whitespace from README.md 2022-11-07 17:36:04 -08:00
Erich Gubler
6e026c8c0a style: EOF newline for ctx.yml 2022-11-07 17:36:04 -08:00
Erich Gubler
46af01c302 build: migrate Rust 1.64 -> 1.65 2022-11-07 17:36:04 -08:00
Erich Gubler
3d76979da6 build(ci): use RUST_VERSION for CTS consistently 2022-11-07 17:36:04 -08:00
Erich Gubler
4a9797276a refactor: resolve clippy::needless_borrow 2022-11-07 17:36:04 -08:00
Erich Gubler
a818b8540a refactor: resolve clippy::needless_return in raw-gles example 2022-11-07 17:36:04 -08:00
Erich Gubler
319a916cb6 refactor: fix label shadow warning for new_alpha_mode 2022-11-07 17:36:04 -08:00
Erich Gubler
fb67de908e refactor: resolve clippy::explicit_auto_deref 2022-11-07 17:36:04 -08:00
Erich Gubler
98eb19c854 refactor: resolve clippy::bool_to_int_with_if 2022-11-07 17:36:04 -08:00
Andreas Reich
a377ae2b7f Alpha to coverage support for GLES (#3187) 2022-11-07 16:56:59 -05:00
Andreas Reich
b838b0871c Added new UNRESTRICTED_INDEX_BUFFER downlevel flag. (#3157)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-11-07 15:45:50 -05:00
Nicolas Silva
db30e3909a Avoid integer overflow on multiplication in write_texture. (#3146) 2022-11-07 15:31:19 -05:00
Erich Gubler
2245227f83 style(wgpu-info): strip trailing newlines 2022-11-07 14:28:08 -03:30
Erich Gubler
17b748a8a4 fix(wgpu-info): s/driver/&_info for DriverInfo line 2022-11-07 14:28:08 -03:30
TheOnlyMrCat
6ed103ec18 Add expose-ids feature (#3104) 2022-11-04 15:28:56 -04:00
Erich Gubler
1650581fe7 refactor(cli): simplify output_paths w/ <&[T]>::get and Option::unwrap (#2114) 2022-11-04 16:20:47 +01:00
Kevin Reid
eda77e6abb Expand documentation of Queue::write_texture. (#3173) 2022-11-03 14:00:56 -04:00
Teodor Tanasoaia
01fbdea21f fix 1.65 clippy lints (#2112) 2022-11-03 18:32:20 +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
Jim Blandy
9fb9dbf653 deno_webgpu: Don't confuse zero with "to the end of the buffer".
`RenderBundleEncoder::set_index_buffer` and `set_vertex_buffer`
interpret a `size` of `None` to mean "from the given offset to the end
of the buffer", but `std::num::NonZeroU64::new` produces `None` when
its argument is zero, which is quite different. Fix this similarly to
the way it's handled in `op_webgpu_render_pass_set_index_buffer`.

The WebGPU spec says this should work; filed as #3170.
2022-11-03 09:14:18 -07:00
Connor Fitzgerald
7f64498d6e Test clamp and Generalize Shader Tests (#3167)
* Sample numeric tests

* Generalize shader tests
2022-11-02 19:42:18 -04:00
Connor Fitzgerald
4d199a38df Forward port v0.14.1 changelog (#3166) 2022-11-02 22:15:03 +00:00
Lilith
a31cd2ef5c Remove DEPTH24PLUS_STENCIL8 feature (#3151) 2022-11-02 16:44:15 -04:00
Imbris
8a7240cdbe Address review comments with small factoring out of conditional failure test pattern. 2022-11-02 02:14:42 -04:00
Imbris
688643d2b6 Indicate in MAPPABLE_PRIMARY_BUFFER docs that it it only supported on
vulkan, dx12, and metal.
2022-11-02 02:14:42 -04:00
Imbris
f018e9539b Rework buffer_usage test to properly check every failure case using error scopes (instead of accidentally just testing the first one). 2022-11-02 02:14:42 -04:00
i509VCB
32febc5c9e export the strict assert macros uniformly 2022-11-01 04:59:24 -04:00
i509VCB
085e41171f use debug_assert_** with not(feature = "strict_asserts")
strict_asserts should at least validate with the debug_assert_** family of macros in debug builds. Otherwise undefined behavior can sneak by.
2022-11-01 04:59:24 -04:00
Harald Reingruber
51b34c5b51 Improve compute shader validation error message (#3139)
* Improve compute shader validation error message

* Add entry to changelog.

* Improve error message wording (by cwfitzgerald)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* Add credit and PR link to changelog

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-10-29 17:49:03 -04:00
Xiaopeng Li
ccabcad6bb Update naga (#3144) 2022-10-28 11:46:43 -04:00
Xiaopeng Li
e7fc8e64f2 Fix textureGather compatibility on macOS 10.13 (#2104)
* Fix textureGather compatibility on macOS 10.13

* Fix tests

* Update src/back/msl/writer.rs

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>

Co-authored-by: Jet Spark <lixiaopeng.jetspark@bytedance.com>
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2022-10-27 09:28:46 +02:00
Connor Fitzgerald
c4533971c0 Struct Alignment Test (#3125) 2022-10-26 23:37:25 +00:00
Jinlei Li
dcc0baa1ff Fix texture_as_hal internal unwrap may cause panic (#3131) 2022-10-26 17:13:43 -04:00
i509VCB
d81cb46be0 enable doc_auto_cfg for docs.rs (#3113)
* enable doc_auto_cfg for docs.rs

This should expose more feature labels in the generated documentation and removes the needs for the manually labeling the features for a type, function or enum variants.

* enable docsrs cfg when building docs for master
2022-10-26 17:07:25 -04:00
Erich Gubler
df4e40327c refactor(wgsl-out): use for loop for function arg. writing 2022-10-26 16:31:48 -04:00
Erich Gubler
469272c613 refactor(valid): s/error/source member name for ValidationError 2022-10-26 16:31:48 -04:00
Erich Gubler
b37dda8854 build: move to the Rust 2021 edition (#2085)
* build: move to the Rust 2021 edition

Since the MSRV of `naga` [is currently 1.56][msrv], I don't think there's a strong reason to stay
with the 2018 edition, and there _are_ a [few good reasons][edition-guide] to move to the 2021
edition.

I did this migration mostly automatically, per [official Rust guidelines]:

```sh
$ cargo fix --edition --all-targets
$ sed -i Cargo.toml 's/2018/2021'
$ cargo fix --edition-idioms --allow-dirty # doesn't change anything
```

The only manual edit needed to stymie a new warning introduced was the removal of the `TryFrom`
import in several modules, since it's now in the 2021 prelude.

[msrv]: a7193d652e/.github/workflows/pipeline.yml (L14)
[edition-guide]: https://doc.rust-lang.org/edition-guide/rust-2021/index.html
[official Rust guidelines]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html#edition-migration

* refactor(wgsl-in): use `pat` instead of `pat_param` again

How we were using `pat` in the Rust 2018 edition is actually the use case that
Rust 2021's `pat` fragment specifier is intended to satisfy. So, let's just use
that!
2022-10-25 08:44:17 -07:00
Erich Gubler
2a11d830bb refactor: factor out new Validator::global_var_ty for expr. validation (#2086) 2022-10-25 08:38:44 -07:00
Raph Levien
ddcd5d3121 Fix incorrect atomic bounds check on metal back-end (#2099)
* Fix incorrect atomic bounds check on metal back-end

Generalize put_atomic_fetch to handle `exchange` as well, rather than special-cased code which didn't do the bounds check (the check handling as fixed in #1703 but only for the fetch cases, exchange was skipped).

Fixes #1848

* Add tests for atomic exchange
2022-10-24 09:20:57 -07:00
Josh Groves
49415fe971 Remove unrelated comment in CompositeAlphaMode (#3129) 2022-10-21 11:32:19 -04:00
Connor Fitzgerald
d974f2f832 [hlsl-out] Properly implement bitcast 2022-10-20 11:00:21 -04:00
Connor Fitzgerald
2754a0136e [hlsl-out] Fix storage access chain through a matrix 2022-10-20 11:00:21 -04:00
Jinlei Li
cc448817e7 Use cargo 1.64 workspace inheritance feature (#3107) 2022-10-20 01:41:17 -04:00
Connor Fitzgerald
20d5445cb7 Workaround FXC Bug in Matrix Indexing (#2096) 2022-10-20 01:37:35 -04:00
Xiaopeng Li
754a4bad80 Add Surface::as_hal_mut (#3123) 2022-10-19 16:06:23 -04:00
Ashley
d3ab5a197e WebGL2 multiview support via OVR_multiview2 (#3121)
* Add OVR_multiview2 support

* Add changelog entry

* Only use multiview on wasm32 + unknown

* Add note to Features::MULTIVIEW
2022-10-18 12:14:18 -04:00
Connor Fitzgerald
ce081796c8 Rework CI (#3097) 2022-10-14 22:55:36 -04:00