Commit Graph
606 Commits
Author SHA1 Message Date
Erich Gubler 5dc1038124 feat(const_eval): impl. saturate 2024-01-18 16:57:46 -05:00
Erich Gubler 87dafb645a feat(const_eval): impl. round 2024-01-18 16:57:46 -05:00
Erich Gubler fc27b08dca feat(const_eval): impl. abs with new component_wise_scalar 2024-01-18 16:57:46 -05:00
Erich Gubler 5c900f2568 refactor(const_eval): add component_wise_float helper, reimpl. math_pow 2024-01-18 16:57:46 -05:00
Erich Gubler c2058487ca chore: run rustfmt in naga 2024-01-18 16:57:46 -05:00
Connor Fitzgerald 7eac4cec5b Fix naga release 2024-01-17 14:47:13 -05:00
Connor Fitzgerald 8b2098bd4e Release 0.19 (#5082) 2024-01-17 14:42:11 -05:00
dependabot[bot] 8c1658f28f Bump the patch-updates group with 11 updates (#5039)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 19:38:11 -05:00
Jim Blandy 8af6975d5e Prefer Arc::into_inner over Arc::try_unwrap. (#5018) 2024-01-08 19:24:33 -05:00
Patryk Wychowaniec e7c7017d2e [naga wgsl-in] Fix parsing break ifs
Closes https://github.com/gfx-rs/wgpu/issues/4982.
2024-01-08 10:50:38 +01:00
dependabot[bot]andAndreas Reich 0005b42648 Bump serde from 1.0.194 to 1.0.195 (#5005)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.194 to 1.0.195.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.194...v1.0.195)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-01-06 09:56:06 -05:00
Connor Fitzgerald 2f87a8ff83 Update Rollup 2024-01-05 10:27:27 +01:00
dependabot[bot] cef6a0c0cf Bump thiserror from 1.0.52 to 1.0.56 (#4978)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 21:54:23 -05:00
dependabot[bot] d03e2907d5 Bump serde from 1.0.193 to 1.0.194 (#4965)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 14:43:34 -05:00
teoxoy b47d4924a8 [glsl-in] fix swizzle in a global const context 2024-01-03 11:34:10 +01:00
dependabot[bot] 430fc0b3a8 Bump thiserror from 1.0.51 to 1.0.52 (#4933)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.51 to 1.0.52.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.51...1.0.52)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 14:04:20 +01:00
Erich Gubler e45a86fa7c [naga xtask] Add and use ValidateSubcommand::all.
Add an `all` method to `ValidateSubcommand`, so that we can just use
matches elsewhere, and let the compile catch missing or duplicated
cases for us.
2023-12-27 13:07:09 -08:00
Jim Blandy 71f18fd61a [naga xtask] Use anyhow::ensure! where appropriate. 2023-12-27 13:07:09 -08:00
Jim Blandy 3e252ac2f3 [naga xtask] Use log::error in preference to eprintln. 2023-12-27 13:07:09 -08:00
Jim Blandy de3df51807 [naga xtask] Add validate all subcommand. 2023-12-27 13:07:09 -08:00
Jim Blandy 403db446e4 [naga xtask] Run validation jobs in parallel, using jobserver. 2023-12-27 13:07:09 -08:00
Jim Blandy 85ab6327d3 [naga xtask] Use indicatif crate to report validation progress. 2023-12-27 13:07:09 -08:00
Jim Blandy a1a8b6d445 [naga xtask] Remove ack_visiting function. 2023-12-27 13:07:09 -08:00
Jim Blandy 0d25acba68 [naga xtask] Collect validation jobs in a Vec before running them. 2023-12-27 13:07:09 -08:00
Jim Blandy 17a9166c26 [naga xtask] Produce output only when an error occurs. 2023-12-27 13:07:09 -08:00
Jim Blandy 41276a1731 [naga xtask] Break validation subcommands into functions. 2023-12-27 13:07:09 -08:00
Jim Blandy 9041bb94db [naga xtask] Move validation subcommands into their own module. 2023-12-27 13:07:09 -08:00
Jim Blandy 9afd54ea24 [naga xtask] Use naga-cli's --bulk-validate option.
Use `naga --bulk-validate` for `cargo xtask validate wgsl`, reducing
runtime from 12s to 0.8s.
2023-12-24 12:03:28 -08:00
Connor Fitzgerald 090f2f757c Use nightly for docs (#4906) 2023-12-20 18:59:22 -05:00
Nicolas Silva 625165e60e Make the naga version in trunk as high as the latest published one. (#4891) 2023-12-18 04:05:16 -05:00
dependabot[bot] 790c40fd44 Bump thiserror from 1.0.50 to 1.0.51 (#4890)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-17 22:10:40 -05:00
Jim Blandy d9d051b7a5 [naga wgsl] Let unary operators accept and produce abstract types.
Fixes #4445.
Fixes #4492.
Fixes #4435.
2023-12-14 10:54:46 +01:00
Jim Blandy c4b43875e5 [naga wgsl-in] Support abstract operands to binary operators. 2023-12-13 08:42:26 -08:00
Jim Blandy f2828ace38 [naga wgsl-in] Separate out convert_to_leaf_scalar.
Abstract out the body of `convert_slice_to_common_leaf_scalar`'s main
loop into its own function. Code motion only, no intended change of
behavior.
2023-12-13 08:42:26 -08:00
Jim Blandy 0df496062e [naga wgsl-in] Rename convert_slice_to_common_leaf_scalar.
This is a mouthful, but it's going to align better with functions to
be introduced in later commits.
2023-12-13 08:42:26 -08:00
Jim Blandy f4161189fa [naga wgsl-in] Relax arg type for automatic_conversion_consensus. 2023-12-13 08:42:26 -08:00
Jim Blandy 84c74adec2 [naga wgsl-in] Relocate automatic_conversion_consensus.
Move `naga::front::wgsl::lower::construction::automatic_conversion_consensus`
into `conversion.rs`, and make it a method of `ExpressionContext`.
2023-12-13 08:42:26 -08:00
Jim Blandy 3ffd5a1e56 [naga wgsl-out] Include the f suffix on f32 literals.
Without the suffix, `Expression::Literal(Literal::F32)` expressions
get written without any suffix on the number, meaning that they get
re-parsed as `AbstractFloat` values. In theory, this should always be
fine, but since we don't actually support abstract types yet in all
the places we should, having them appear in the output causes
validation problems.

See also: #4863, which did the same for `i32` literals.
2023-12-13 13:42:05 +01:00
Jim Blandy 6dc9ccab85 [naga wgsl-out] Include the i suffix on i32 literals. (#4863)
Without the suffix, `Expression::Literal(Literal::I32)` expressions
get written without any suffix on the decimal number, meaning that
they get re-parsed as AbstractInt values. In theory, this should
always be fine, but since we don't actually support abstract types yet
in all the places we should, having them appear in the output causes
validation problems.
2023-12-12 12:07:10 +00:00
Jim Blandy 4b6a2d1dfa [naga] Teach the constant evaluator vector/vector operators.
Allow constant evaluation of binary operators whose left and right
operands are both vectors.
2023-12-12 12:48:10 +01:00
Jim Blandy 0e41cfe4ca [naga] Change operators.wgsl to use values that matter.
Change `splat` to take run-time values as arguments, to prevent
constant evaluation from boiling everything away.
2023-12-12 12:48:10 +01:00
Jim Blandy 439bf3c1b4 [naga wgsl-in] Improve error message for failed concretization. 2023-12-12 12:48:10 +01:00
teoxoy 411c1e5b21 [spv-out] Decorate all non-uniform binding array access chains as NonUniform, not just buffer binding arrays.
Apply the `NonUniform` decoration to the results of all access chains rooted in binding arrays that use non-uniform values as indices, regardless of the binding array's element type and address space. Previously, Naga only decorated non-uniform access chains for binding arrays of buffers.
2023-12-07 19:01:04 +01:00
Jim Blandy f470103874 [naga wgsl-in] Automatic conversions for local var initializers. 2023-12-06 10:35:21 +01:00
Jim Blandy 1676ee0dc0 [naga wgsl-in] Automatic conversions for global var initializers. 2023-12-06 10:35:21 +01:00
Jim Blandy 19702108ab [naga] Rename abstract-types snapshots abstract-types-const.
This prepares for introducing a similar test for global variables.
2023-12-06 10:35:21 +01:00
Teodor Tanasoaia dd7e33250b fix expected error message 2023-12-04 14:06:33 +01:00
Jim Blandy 33339e46ce [naga wgsl-in] Drop spanless labels from front-end error messages.
When a label in a WGSL front end error has an undefined span, omit the
label from the error message. This is not great, but because of the
way Naga IR represents local variable references it is hard to get the
right span, and omitting the label better than panicking in `unwrap`,
since the error message has a general message anyway.
2023-12-04 12:22:13 +01:00
Jim Blandy 07b83ab6c0 [naga wgsl-in] Use a better span for errors in constructors.
When reporting errors in construction expressions, use the span of the
constructor itself (that is, the type name) in preference to the span
of the overall expression. This makes errors easier to follow.
2023-12-04 12:20:22 +01:00
LeonandConnor Fitzgerald 1823f8bbdf Fixes and changes to the documentation for increasing clarity (#4806)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-01 14:02:00 -05:00