teoxoy
c2e520c52c
[naga] add Expression::Override
to needs_pre_emit
2024-04-22 08:38:31 -07:00
teoxoy
ca729cc607
Introduce HashableLiteral
...
The only reason `Literal` had to implement `Eq` and `Hash` was due to the SPV backend having to cache those in a `HashMap`.
The `PartialEq` impl was error prone due to the match not being exhaustive.
2024-04-18 12:26:24 -07:00
Teodor Tanasoaia
d08a069573
Fix vectors being unconditionally host shareable ( #5556 )
2024-04-18 10:02:18 -04:00
vero
4e77762a32
Refactor MSL atomic writing ( #5533 )
2024-04-18 12:23:45 +02:00
vero
163ffa6d63
Refactor WGSL atomic writing ( #5534 )
2024-04-18 10:57:35 +02:00
dependabot[bot]
1735968969
build(deps): bump the patch-updates group with 23 updates ( #5550 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 20:14:55 -04:00
Alexander Meißner
ea77d5674d
Subgroup Operations ( #5301 )
...
Co-authored-by: Jacob Hughes <j@distanthills.org>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: atlas dostal <rodol@rivalrebels.com>
2024-04-17 15:25:52 -04:00
vero
c6efbef8a6
Make scalar_width
return size in bytes ( #5532 )
2024-04-15 20:05:42 +02:00
teoxoy
9df68197a4
[spv-in] add support for specialization constants
2024-04-11 09:46:55 -07:00
Andreas Reich
82dead09e4
Bump wgpu-core/hal/types & naga versions to match latest released patch versions ( #5404 )
2024-04-09 00:33:43 -04:00
dependabot[bot]
73738afa82
build(deps): bump the patch-updates group with 35 updates ( #5507 )
...
Bumps the patch-updates group with 35 updates:
| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags ) | `2.4.2` | `2.5.0` |
| [futures-lite](https://github.com/smol-rs/futures-lite ) | `2.2.0` | `2.3.0` |
| [getrandom](https://github.com/rust-random/getrandom ) | `0.2.12` | `0.2.13` |
| [glam](https://github.com/bitshifter/glam-rs ) | `0.25.0` | `0.27.0` |
| [heck](https://github.com/withoutboats/heck ) | `0.4.1` | `0.5.0` |
| [serde_json](https://github.com/serde-rs/json ) | `1.0.114` | `1.0.115` |
| [smallvec](https://github.com/servo/rust-smallvec ) | `1.13.1` | `1.13.2` |
| [tokio](https://github.com/tokio-rs/tokio ) | `1.36.0` | `1.37.0` |
| [indexmap](https://github.com/indexmap-rs/indexmap ) | `2.2.5` | `2.2.6` |
| [syn](https://github.com/dtolnay/syn ) | `2.0.52` | `2.0.58` |
| [ab_glyph](https://github.com/alexheretic/ab-glyph ) | `0.2.23` | `0.2.24` |
| [aho-corasick](https://github.com/BurntSushi/aho-corasick ) | `1.1.2` | `1.1.3` |
| [async-trait](https://github.com/dtolnay/async-trait ) | `0.1.77` | `0.1.79` |
| [autocfg](https://github.com/cuviper/autocfg ) | `1.1.0` | `1.2.0` |
| [backtrace](https://github.com/rust-lang/backtrace-rs ) | `0.3.69` | `0.3.71` |
| [bytes](https://github.com/tokio-rs/bytes ) | `1.5.0` | `1.6.0` |
| [cc](https://github.com/rust-lang/cc-rs ) | `1.0.90` | `1.0.91` |
| [clap](https://github.com/clap-rs/clap ) | `4.5.2` | `4.5.4` |
| [clap_derive](https://github.com/clap-rs/clap ) | `4.5.0` | `4.5.4` |
| [downcast-rs](https://github.com/marcianx/downcast-rs ) | `1.2.0` | `1.2.1` |
| [fastrand](https://github.com/smol-rs/fastrand ) | `2.0.1` | `2.0.2` |
| [half](https://github.com/starkat99/half-rs ) | `2.4.0` | `2.4.1` |
| [itoa](https://github.com/dtolnay/itoa ) | `1.0.10` | `1.0.11` |
| [memchr](https://github.com/BurntSushi/memchr ) | `2.7.1` | `2.7.2` |
| [pin-project-lite](https://github.com/taiki-e/pin-project-lite ) | `0.2.13` | `0.2.14` |
| [polling](https://github.com/smol-rs/polling ) | `3.5.0` | `3.6.0` |
| [rayon](https://github.com/rayon-rs/rayon ) | `1.9.0` | `1.10.0` |
| [regex](https://github.com/rust-lang/regex ) | `1.10.3` | `1.10.4` |
| [regex-syntax](https://github.com/rust-lang/regex ) | `0.8.2` | `0.8.3` |
| [rustix](https://github.com/bytecodealliance/rustix ) | `0.38.31` | `0.38.32` |
| [rustversion](https://github.com/dtolnay/rustversion ) | `1.0.14` | `1.0.15` |
| [uuid](https://github.com/uuid-rs/uuid ) | `1.7.0` | `1.8.0` |
| [widestring](https://github.com/starkat99/widestring-rs ) | `1.0.2` | `1.1.0` |
| [xml-rs](https://github.com/kornelski/xml-rs ) | `0.8.19` | `0.8.20` |
Updates `bitflags` from 2.4.2 to 2.5.0
- [Release notes](https://github.com/bitflags/bitflags/releases )
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md )
- [Commits](https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0 )
Updates `futures-lite` from 2.2.0 to 2.3.0
- [Release notes](https://github.com/smol-rs/futures-lite/releases )
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md )
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.2.0...v2.3.0 )
Updates `getrandom` from 0.2.12 to 0.2.13
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.12...v0.2.13 )
Updates `heck` from 0.4.1 to 0.5.0
- [Changelog](https://github.com/withoutboats/heck/blob/master/CHANGELOG.md )
- [Commits](https://github.com/withoutboats/heck/commits )
Updates `serde_json` from 1.0.114 to 1.0.115
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.114...v1.0.115 )
Updates `smallvec` from 1.13.1 to 1.13.2
- [Release notes](https://github.com/servo/rust-smallvec/releases )
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.13.1...v1.13.2 )
Updates `tokio` from 1.36.0 to 1.37.0
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.36.0...tokio-1.37.0 )
Updates `indexmap` from 2.2.5 to 2.2.6
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md )
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.5...2.2.6 )
Updates `syn` from 2.0.52 to 2.0.58
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.52...2.0.58 )
Updates `ab_glyph` from 0.2.23 to 0.2.24
- [Release notes](https://github.com/alexheretic/ab-glyph/releases )
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.23...ab-glyph-0.2.24 )
Updates `aho-corasick` from 1.1.2 to 1.1.3
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.1.2...1.1.3 )
Updates `async-trait` from 0.1.77 to 0.1.79
- [Release notes](https://github.com/dtolnay/async-trait/releases )
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.77...0.1.79 )
Updates `autocfg` from 1.1.0 to 1.2.0
- [Commits](https://github.com/cuviper/autocfg/compare/1.1.0...1.2.0 )
Updates `backtrace` from 0.3.69 to 0.3.71
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases )
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.69...0.3.71 )
Updates `bytes` from 1.5.0 to 1.6.0
- [Release notes](https://github.com/tokio-rs/bytes/releases )
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md )
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.5.0...v1.6.0 )
Updates `cc` from 1.0.90 to 1.0.91
- [Release notes](https://github.com/rust-lang/cc-rs/releases )
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.90...1.0.91 )
Updates `clap` from 4.5.2 to 4.5.4
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.2...v4.5.4 )
Updates `clap_derive` from 4.5.0 to 4.5.4
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.0...v4.5.4 )
Updates `downcast-rs` from 1.2.0 to 1.2.1
- [Changelog](https://github.com/marcianx/downcast-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/marcianx/downcast-rs/compare/v1.2.0...v1.2.1 )
Updates `fastrand` from 2.0.1 to 2.0.2
- [Release notes](https://github.com/smol-rs/fastrand/releases )
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md )
- [Commits](https://github.com/smol-rs/fastrand/compare/v2.0.1...v2.0.2 )
Updates `half` from 2.4.0 to 2.4.1
- [Release notes](https://github.com/starkat99/half-rs/releases )
- [Changelog](https://github.com/starkat99/half-rs/blob/main/CHANGELOG.md )
- [Commits](https://github.com/starkat99/half-rs/compare/v2.4.0...v2.4.1 )
Updates `itoa` from 1.0.10 to 1.0.11
- [Release notes](https://github.com/dtolnay/itoa/releases )
- [Commits](https://github.com/dtolnay/itoa/compare/1.0.10...1.0.11 )
Updates `memchr` from 2.7.1 to 2.7.2
- [Commits](https://github.com/BurntSushi/memchr/compare/2.7.1...2.7.2 )
Updates `pin-project-lite` from 0.2.13 to 0.2.14
- [Release notes](https://github.com/taiki-e/pin-project-lite/releases )
- [Changelog](https://github.com/taiki-e/pin-project-lite/blob/main/CHANGELOG.md )
- [Commits](https://github.com/taiki-e/pin-project-lite/compare/v0.2.13...v0.2.14 )
Updates `polling` from 3.5.0 to 3.6.0
- [Release notes](https://github.com/smol-rs/polling/releases )
- [Changelog](https://github.com/smol-rs/polling/blob/master/CHANGELOG.md )
- [Commits](https://github.com/smol-rs/polling/compare/v3.5.0...v3.6.0 )
Updates `rayon` from 1.9.0 to 1.10.0
- [Changelog](https://github.com/rayon-rs/rayon/blob/main/RELEASES.md )
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.9.0...rayon-core-v1.10.0 )
Updates `regex` from 1.10.3 to 1.10.4
- [Release notes](https://github.com/rust-lang/regex/releases )
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/regex/compare/1.10.3...1.10.4 )
Updates `regex-syntax` from 0.8.2 to 0.8.3
- [Release notes](https://github.com/rust-lang/regex/releases )
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.2...regex-syntax-0.8.3 )
Updates `rustix` from 0.38.31 to 0.38.32
- [Release notes](https://github.com/bytecodealliance/rustix/releases )
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.31...v0.38.32 )
Updates `rustversion` from 1.0.14 to 1.0.15
- [Release notes](https://github.com/dtolnay/rustversion/releases )
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.14...1.0.15 )
Updates `uuid` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/uuid-rs/uuid/releases )
- [Commits](https://github.com/uuid-rs/uuid/compare/1.7.0...1.8.0 )
Updates `widestring` from 1.0.2 to 1.1.0
- [Release notes](https://github.com/starkat99/widestring-rs/releases )
- [Changelog](https://github.com/starkat99/widestring-rs/blob/main/CHANGELOG.md )
- [Commits](https://github.com/starkat99/widestring-rs/compare/v1.0.2...v1.1.0 )
Updates `xml-rs` from 0.8.19 to 0.8.20
- [Changelog](https://github.com/kornelski/xml-rs/blob/main/Changelog.md )
- [Commits](https://github.com/kornelski/xml-rs/compare/0.8.19...0.8.20 )
---
updated-dependencies:
- dependency-name: bitflags
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: futures-lite
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: getrandom
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: heck
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: smallvec
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: indexmap
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: ab_glyph
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: aho-corasick
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: async-trait
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: autocfg
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: backtrace
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: bytes
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: cc
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: clap
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: clap_derive
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: downcast-rs
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: fastrand
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: half
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: itoa
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: memchr
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: pin-project-lite
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: polling
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: rayon
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: regex
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: regex-syntax
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: rustix
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: rustversion
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: uuid
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: widestring
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: xml-rs
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-04-09 00:20:27 -04:00
wicast
17ef6cac90
fix(spv-out): OpSourceContinued for large source (gfx-rs#5390)
2024-04-08 11:27:18 +02:00
vero
911baf3e8c
Add DirectX ShaderModel 6.1-6.7 detection ( #5498 )
2024-04-06 11:35:59 +02:00
vero
1c48a23cff
Add Metal 3.0 and 3.1 detection ( #5497 )
2024-04-05 19:22:33 +02:00
Jim Blandy
2ad95b2774
[naga wgsl-in] Allow override expressions as local var initializers.
...
Allow `LocalVariable::init` to be an override expression.
Note that this is unrelated to WGSL compliance. The WGSL front end
already accepts any sort of expression as an initializer for
`LocalVariable`s, but initialization by an override expression was
handled in the same way as initialization by a runtime expression, via
an explicit `Store` statement.
This commit merely lets us skip the `Store` when the initializer is an
override expression, producing slightly cleaner output in some cases.
2024-04-05 18:07:41 +02:00
teoxoy
7df0aa6364
move the burden of evaluating override-expressions to users of naga's API
2024-04-05 18:07:41 +02:00
Jim Blandy
ba19d8df34
[naga] Adjust RayQuery statements in override processing.
2024-04-05 18:07:41 +02:00
Jim Blandy
906ed128de
[naga] Spell out members in adjust_expr.
2024-04-05 18:07:41 +02:00
Jim Blandy
8a2bc07f11
[naga] Handle comparison operands in pipeline constant evaluation.
...
Properly adjust `AtomicFunction::Exchange::compare` after pipeline
constant evaluation.
2024-04-05 18:07:41 +02:00
Jim Blandy
a7d8ee999d
[naga] Add missing newline to test input file.
2024-04-05 18:07:41 +02:00
Jim Blandy
8107f80b7f
[naga] Tweak comments in ConstantEvaluator::try_eval_and_append
.
...
I found I needed a little bit more detail here.
2024-04-05 18:07:41 +02:00
Jim Blandy
bb15286df2
[naga] Let filter_emits_with_block
operate on a &mut Block
.
...
This removes some clones and collects, simplifies call sites, and
isn't any more complicated to implement.
2024-04-05 18:07:41 +02:00
Jim Blandy
aaf3b17623
[naga] Hoist ConstantEvaluator
construction in process_function
.
...
There's no need to build a fresh `ConstantEvaluator` for every
expression; just build it once and reuse it.
2024-04-05 18:07:41 +02:00
Jim Blandy
f464598646
[naga] Simplify uses of replace
in back::pipeline_constants
.
2024-04-05 18:07:41 +02:00
Jim Blandy
58d1e1f745
[naga] Doc tweaks for back::pipeline_constants
.
2024-04-05 18:07:41 +02:00
teoxoy
ca252b9e74
allow private variables to have an override-expression initializer
2024-04-05 18:07:41 +02:00
teoxoy
3abdfde0ba
evaluate override-expressions in functions
2024-04-05 18:07:41 +02:00
teoxoy
fd5c4db606
refactor try_eval_and_append
body
2024-04-05 18:07:41 +02:00
Jim Blandy
dd315ee39a
[naga] Add some documentation to process_overrides and subroutines.
2024-04-05 18:07:41 +02:00
teoxoy
4ede83929c
[valid] make sure overrides are not present after evaluation
2024-04-05 18:07:41 +02:00
teoxoy
f1706b994b
[valid] error on non fully evaluated const-expressions
2024-04-05 18:07:41 +02:00
teoxoy
e9eb703941
rename const_expressions
to global_expressions
2024-04-05 18:07:41 +02:00
teoxoy
fa5406fbb9
rename ExpressionConstnessTracker
to ExpressionKindTracker
2024-04-05 18:07:41 +02:00
teoxoy
d6ebd88f42
implement override-expression evaluation for initializers of override declarations
2024-04-05 18:07:41 +02:00
teoxoy
ff332afdef
[const-eval] fix evaluation of bool constuctors
2024-04-05 18:07:41 +02:00
teoxoy
a946a6f0ad
[const-eval] refactor logic around try_eval_and_append
2024-04-05 18:07:41 +02:00
teoxoy
d7cfe16b79
validate that override ids are unique
2024-04-05 18:07:41 +02:00
teoxoy
2929ec333c
[spv/msl/hlsl-out] support pipeline constant value replacements
2024-04-05 18:07:41 +02:00
teoxoy
7ce422c57a
remove naga's clone feature
2024-04-05 18:07:41 +02:00
Teodor Tanasoaia
f949ea69c4
[wgsl-in] add support for override declarations ( #4793 )
...
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-04-05 18:07:41 +02:00
Jim Blandy
b3dfc40c9d
[naga] Delete Constant::override
and Override
.
2024-04-05 18:07:41 +02:00
teoxoy
3bda381812
add pipeline constants plumbing
2024-04-05 18:07:41 +02:00
Erich Gubler
fb305b85f6
docs: add warning about stack size for WGSL compilation
2024-04-03 15:54:43 -04:00
Erich Gubler
b21a3265de
fix(wgsl-in)!: limit brace recursion
2024-04-03 15:54:43 -04:00
Erich Gubler
d4b673c88a
refactor(wgsl-in): remove unnecessary return Ok(())
2024-04-03 15:54:43 -04:00
Dzmitry Malyshau
3a467ad93d
spv-out: Support arrayLength of a dynamically indexed bindings array
2024-04-02 19:22:34 +02:00
Dzmitry Malyshau
bfe0b90740
spv-out: implement OpArrayLength on array buffer bindings
2024-04-02 19:22:34 +02:00
Christian Legnitto
1fd47b54ab
Expose all items in naga::back
.
...
This helps out-of-tree backends.
Fixes https://github.com/gfx-rs/wgpu/issues/5398 .
2024-04-02 17:14:13 +02:00
Vecvec
1ead28701d
Fix unused acceleration structures causing invalid SPIR-V ( #5463 )
2024-04-02 11:06:28 +00:00
Thomas Bork
dc7cbe6e8b
docs: Fix incorrect git URL for naga-cli installation ( #5457 )
2024-04-02 12:54:27 +02:00
Christian Legnitto
0f4839c466
Include the glsl global name in entrypoint arguments. ( #5418 )
2024-03-28 18:19:51 +01:00
Jim Blandy
c613fbbeed
[naga] Add some documentation for the uniformity analysis.
...
This is Naga's classic, over-conservative, non-standard-compliant
uniformity analysis. But it's still good to know what the heck it's
doing.
2024-03-28 17:36:58 +01:00
dependabot[bot]
e04a9f4c6f
build(deps): bump the patch-updates group with 29 updates ( #5376 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 13:00:43 -04:00
stefnotch
6a5418b93f
Fix 5385 by updating the documentation ( #5386 )
...
* Fix 5385 by updating the documentation
* Update changelog
2024-03-13 21:30:50 -04:00
vero
4e6f873da5
Add shader I64 and U64 support ( #5154 )
...
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-03-12 12:34:06 +01:00
Teodor Tanasoaia
3107f5e148
[mtl-out] Add "assert" to reserved words
2024-03-12 10:52:37 +01:00
Jim Blandy
14dbf8c60e
[naga] Document the absence of "phi" expressions.
2024-03-07 12:46:25 +01:00
Jim Blandy
8ee3c414f0
[naga] Document return types of image query operations.
2024-03-07 12:45:22 +01:00
Erik Zivkovic
d417433e0c
Naga: GLSL 410 does not support layout(binding = ...)
...
Naga assumed that GLSL 410 supported layout(binding = ...) but it does not,
it only supports layout(location = ...). It is not possible to enable only
layout(location = ...) currently, so we need to predicate the feature on GLSL
420 instead.
2024-03-07 12:28:26 +01:00
Jim Blandy
ffaabeb921
[naga xtask] Update Cargo.lock for dependabot #5241 .
...
The dependabot PR #5241 made `naga/hlsl-snapshots` depend on nanoserde 0.1.37,
but didn't regenerate `naga/xtask/Cargo.lock`.
2024-03-07 12:14:02 +01:00
Connor Fitzgerald
a5c0181c3a
Bitfield Fixes ( #5305 )
2024-02-29 20:50:42 +00:00
Jim Blandy
b020b984df
[naga] Fix docs generated by gen_component_wise_extractor
. ( #5314 )
2024-02-29 15:39:27 -05:00
Connor Fitzgerald
8129897ccb
Nested loop test
2024-02-28 13:54:27 +01:00
dependabot[bot]
744454b9e2
Bump Many Dependencies and MSRV ( #5241 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-02-27 14:43:05 -05:00
Connor Fitzgerald
38419a9cf2
Fix Integer Clamp ( #5300 )
...
* Fix Integer Clamp
* Changelog
2024-02-26 20:28:23 +01:00
JMS55
5b9ade8223
Add AccelerationStructure to WGSL write_value_type ( #5261 )
2024-02-24 02:41:37 -05:00
Imbris
abc0b30dfc
Add test case for builtin only accessed in function parsed after the entry point function
2024-02-15 18:12:25 +01:00
Imbris
8b818a2076
Defer entry-point processing so that all potential uses of builtin's are found before culling the unused ones
2024-02-15 18:12:25 +01:00
Imbris
6223af3860
Extract entry point processing from parse_function into an independent function.
2024-02-15 18:12:25 +01:00
Imbris
ae22743326
Add test case to naga/spv-in for an unnamed glPerVertex struct
2024-02-15 18:12:25 +01:00
Imbris
4554f852c1
[spv-in] Remove providing "perVertexStruct" for certain unnamed inputs
...
since we probably shouldn't be naming things if they don't have a name
in the input.
As requested here: https://github.com/gfx-rs/wgpu/pull/5227#issuecomment-1936027091
2024-02-15 18:12:25 +01:00
Imbris
b704132b4c
Remove unnecessary "gl_PerVertex" name check so unused builtins will be
...
handled even when this name is not in the input SPIRV.
2024-02-15 18:12:25 +01:00
Christian Schwarz
2382c8e74f
Fix glsl backend errors regarding samplerCubeArrayShadow ( #5171 )
...
* add GL_EXT_texture_shadow_lod feature detection
* allow more cases of cube depth texture sampling in glsl
* add test for sampling a cubemap array depth texture with lod
* add test for chosing GL_EXT_texture_shadow_lod over the grad workaround if instructed
* add changelog entry for GL_EXT_texture_shadow_lod
* fix criteria for requiring and using TEXTURE_SHADOW_LOD
* require gles 320 for textureSampling over cubeArrayShadow
* prevent false positives in TEXTURE_SHADOW_LOD in checks
* make workaround_lod_with_grad usecase selection less context dependant
* move 3d array texture error into the validator
* correct ImageSample logic errors
2024-02-08 18:27:58 +01:00
Connor Fitzgerald
faed98b45c
Add typos
to Repository CI ( #5191 )
...
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-02-05 12:30:29 -05:00
Erich Gubler
443d5f93dc
style(const_eval): match variant decl. order of current MathFunction
impls.
2024-01-30 10:53:03 +01:00
Erich Gubler
c559be933b
feat(const_eval): impl. min
2024-01-30 10:53:03 +01:00
Erich Gubler
abcc6ddff3
feat(const_eval): impl. max
2024-01-30 10:53:03 +01:00
Erich Gubler
18f50092a6
feat(const_eval): impl. trunc
2024-01-30 10:53:03 +01:00
Erich Gubler
2d3005b745
feat(const_eval): impl. sign
with new component_wise_signed
2024-01-30 10:53:03 +01:00
Erich Gubler
0bd5f77601
feat(const_eval): impl. reverseBits
2024-01-30 10:53:03 +01:00
Erich Gubler
7dedd002c0
feat(const_eval): impl. radians
2024-01-30 10:53:03 +01:00
Erich Gubler
e6f6eb7036
feat(const_eval): impl. log2
2024-01-30 10:53:03 +01:00
Erich Gubler
39cb92cf88
feat(const_eval): impl. log
2024-01-30 10:53:03 +01:00
Erich Gubler
4db02d1962
feat(const_eval): impl. fract
2024-01-30 10:53:03 +01:00
Erich Gubler
fc04518750
feat(const_eval): impl. inverseSqrt
2024-01-30 10:53:03 +01:00
Erich Gubler
19f5e4d5e4
feat(const_eval): impl. fma
2024-01-30 10:53:03 +01:00
Erich Gubler
7b274fc161
feat(const_eval): impl. exp2
2024-01-30 10:53:03 +01:00
Erich Gubler
0f8adae123
feat(const_eval): impl. degrees
2024-01-30 10:53:03 +01:00
Erich Gubler
01d02caca3
feat(const_eval): impl. exp
2024-01-30 10:53:03 +01:00
Erich Gubler
66fd1872ab
feat(const_eval): impl. countTrailingZeros
2024-01-30 10:53:03 +01:00
Erich Gubler
2ccc4f49ee
feat(const_eval): impl. countOneBits
2024-01-30 10:53:03 +01:00
Erich Gubler
ea044f039c
feat(const_eval): impl. countLeadingZeros
with new component_wise_concrete_int
2024-01-30 10:53:03 +01:00
Erich Gubler
7f70df0c47
feat(const_eval): impl. floor
2024-01-30 10:53:03 +01:00
Erich Gubler
a05cc37e3c
feat(const_eval): impl. ceil
2024-01-30 10:53:03 +01:00
wayne
c4b5cc94ad
don't panic if naga parsing of shader source fails ( #5034 )
...
* naga: glsl parser should return singular ParseError similar to wgsl
* wgpu: treat glsl the same as wgsl when creating ShaderModule
* naga: update glsl parser tests to use new ParseError type
* naga: glsl ParseError errors field should be public
* wgpu-core: add 'glsl' feature
* fix some minor bugs in glsl parse error refactor
* naga/wgpu/wgpu-core: improve spirv parse error handling
* wgpu-core: feature gate use of glsl and spv naga modules
* wgpu: enable wgpu-core glsl and spirv features when appropriate
* obey clippy
* naga: derive Clone in Type
* naga: don't feature gate Clone derivation for Type
* obey cargo fmt
* wgpu-core: use bytemuck instead of zerocopy
* wgpu-core: apply suggested edit
* wgpu-core: no need to borrow spirv code
* Update wgpu/src/backend/wgpu_core.rs
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
---------
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
2024-01-23 10:25:25 -05:00
Erich Gubler
2ee7604307
fix(const_eval): use component count, not arg. count, for component-wise iter.
2024-01-22 10:31:53 +01:00
dependabot[bot]
a0862aabb4
build(deps): bump the patch-updates group with 16 updates ( #5115 )
...
Bumps the patch-updates group with 16 updates:
| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags ) | `2.4.1` | `2.4.2` |
| [env_logger](https://github.com/rust-cli/env_logger ) | `0.10.1` | `0.10.2` |
| [smallvec](https://github.com/servo/rust-smallvec ) | `1.12.0` | `1.13.1` |
| [winit](https://github.com/rust-windowing/winit ) | `0.29.9` | `0.29.10` |
| [anstream](https://github.com/rust-cli/anstyle ) | `0.6.7` | `0.6.11` |
| [clap](https://github.com/clap-rs/clap ) | `4.4.16` | `4.4.18` |
| [fdeflate](https://github.com/image-rs/fdeflate ) | `0.3.3` | `0.3.4` |
| [hermit-abi](https://github.com/hermitcore/hermit-rs ) | `0.3.3` | `0.3.4` |
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys ) | `0.4.12` | `0.4.13` |
| [pkg-config](https://github.com/rust-lang/pkg-config-rs ) | `0.3.28` | `0.3.29` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2 ) | `1.0.76` | `1.0.78` |
| [rayon](https://github.com/rayon-rs/rayon ) | `1.8.0` | `1.8.1` |
| [regex](https://github.com/rust-lang/regex ) | `1.10.2` | `1.10.3` |
| [smol_str](https://github.com/rust-analyzer/smol_str ) | `0.2.0` | `0.2.1` |
| [unicode-bidi](https://github.com/servo/unicode-bidi ) | `0.3.14` | `0.3.15` |
| [uuid](https://github.com/uuid-rs/uuid ) | `1.6.1` | `1.7.0` |
Updates `bitflags` from 2.4.1 to 2.4.2
- [Release notes](https://github.com/bitflags/bitflags/releases )
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md )
- [Commits](https://github.com/bitflags/bitflags/compare/2.4.1...2.4.2 )
Updates `env_logger` from 0.10.1 to 0.10.2
- [Release notes](https://github.com/rust-cli/env_logger/releases )
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.1...v0.10.2 )
Updates `smallvec` from 1.12.0 to 1.13.1
- [Release notes](https://github.com/servo/rust-smallvec/releases )
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.12.0...v1.13.1 )
Updates `winit` from 0.29.9 to 0.29.10
- [Release notes](https://github.com/rust-windowing/winit/releases )
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-windowing/winit/compare/v0.29.9...v0.29.10 )
Updates `anstream` from 0.6.7 to 0.6.11
- [Commits](https://github.com/rust-cli/anstyle/compare/anstream-v0.6.7...anstream-v0.6.11 )
Updates `clap` from 4.4.16 to 4.4.18
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.16...v4.4.18 )
Updates `fdeflate` from 0.3.3 to 0.3.4
- [Changelog](https://github.com/image-rs/fdeflate/blob/main/CHANGES.md )
- [Commits](https://github.com/image-rs/fdeflate/compare/v0.3.3...v0.3.4 )
Updates `hermit-abi` from 0.3.3 to 0.3.4
- [Release notes](https://github.com/hermitcore/hermit-rs/releases )
- [Commits](https://github.com/hermitcore/hermit-rs/compare/hermit-abi-0.3.3...hermit-abi-0.3.4 )
Updates `linux-raw-sys` from 0.4.12 to 0.4.13
- [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.4.12...v0.4.13 )
Updates `pkg-config` from 0.3.28 to 0.3.29
- [Changelog](https://github.com/rust-lang/pkg-config-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/pkg-config-rs/compare/0.3.28...0.3.29 )
Updates `proc-macro2` from 1.0.76 to 1.0.78
- [Release notes](https://github.com/dtolnay/proc-macro2/releases )
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.76...1.0.78 )
Updates `rayon` from 1.8.0 to 1.8.1
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md )
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.8.0...rayon-core-v1.8.1 )
Updates `regex` from 1.10.2 to 1.10.3
- [Release notes](https://github.com/rust-lang/regex/releases )
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/regex/compare/1.10.2...1.10.3 )
Updates `smol_str` from 0.2.0 to 0.2.1
- [Commits](https://github.com/rust-analyzer/smol_str/commits )
Updates `unicode-bidi` from 0.3.14 to 0.3.15
- [Release notes](https://github.com/servo/unicode-bidi/releases )
- [Commits](https://github.com/servo/unicode-bidi/commits )
Updates `uuid` from 1.6.1 to 1.7.0
- [Release notes](https://github.com/uuid-rs/uuid/releases )
- [Commits](https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0 )
---
updated-dependencies:
- dependency-name: bitflags
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: env_logger
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: smallvec
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: patch-updates
- dependency-name: winit
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: anstream
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: clap
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: fdeflate
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: hermit-abi
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: linux-raw-sys
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: pkg-config
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: proc-macro2
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: rayon
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: regex
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: smol_str
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: unicode-bidi
dependency-type: indirect
update-type: version-update:semver-patch
dependency-group: patch-updates
- dependency-name: uuid
dependency-type: indirect
update-type: version-update:semver-minor
dependency-group: patch-updates
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 01:00:32 -05:00
Erich Gubler
063e11027b
refactor(const_eval): inline math_pow
2024-01-18 16:57:46 -05:00
Erich Gubler
c2f110ed0c
feat(const_eval): impl. atanh
2024-01-18 16:57:46 -05:00
Erich Gubler
262c07f40c
feat(const_eval): impl. atan
2024-01-18 16:57:46 -05:00
Erich Gubler
f8113c55b7
feat(const_eval): impl. asinh
2024-01-18 16:57:46 -05:00
Erich Gubler
e2783c7d45
feat(const_eval): impl. asin
2024-01-18 16:57:46 -05:00
Erich Gubler
afb54d58ba
feat(const_eval): impl. acosh
2024-01-18 16:57:46 -05:00
Erich Gubler
6654c68950
feat(const_eval): impl. acos
2024-01-18 16:57:46 -05:00
Erich Gubler
12b11f870b
feat(const_eval): impl. cosh
2024-01-18 16:57:46 -05:00
Erich Gubler
7528b22e57
feat(const_eval): impl. cos
2024-01-18 16:57:46 -05:00
Erich Gubler
3ab9a80815
feat(const_eval): impl. tanh
2024-01-18 16:57:46 -05:00
Erich Gubler
bdf1cb4ec3
feat(const_eval): impl. tan
2024-01-18 16:57:46 -05:00
Erich Gubler
29a46234f4
feat(const_eval)!: reimpl. clamp
2024-01-18 16:57:46 -05:00
Erich Gubler
6f5b2a64e2
feat(const_eval): impl. step
2024-01-18 16:57:46 -05:00
Erich Gubler
f2dbdfcdc6
feat(const_eval): impl. sqrt
2024-01-18 16:57:46 -05:00
Erich Gubler
133b573133
feat(const_eval): impl. sinh
2024-01-18 16:57:46 -05:00
Erich Gubler
99a38c7b7c
feat(const_eval): impl. sin
2024-01-18 16:57:46 -05:00
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 if
s
...
Closes https://github.com/gfx-rs/wgpu/issues/4982 .
2024-01-08 10:50:38 +01:00
dependabot[bot]
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:🚧 :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
Leon
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
Jim Blandy
a9c582166d
[naga] Improve ConstantEvaluatorError::InvalidCastArg message.
2023-11-29 19:56:47 +01:00
Jim Blandy
5a3887a49f
[naga wgsl-in] Constructors with types don't make abstract values.
...
When a constructor builtin has an explicit type parameter, like
`mat2x2<f32>`, it should not produce an abstract matrix, even if its
arguments are abstract.
2023-11-29 08:58:47 +01:00
Jim Blandy
fe4d412aea
[naga wgsl-in] Matrix constructors have only float overloads.
2023-11-29 08:58:47 +01:00
Jim Blandy
85dd4048df
[naga] Improve snapshot output when validation fails.
2023-11-29 08:58:47 +01:00
Jim Blandy
50a75fb79f
[naga wgsl-in] Clarify match in automatic_conversion_join
.
...
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-11-29 08:58:47 +01:00
Jim Blandy
601f235b34
[naga wgsl-in] Implement abstract types for consts, constructors.
2023-11-29 08:58:47 +01:00
Jim Blandy
0b79599a8e
[wgsl-in]: Remove Components::Many::first_component_ty_inner
.
...
Delete the `first_component_ty_inner` field from
`front::wgsl::lower:🚧 :Components::Many`. With the
introduction of abstract types, it will no longer be possible to infer
the type of the vector being constructed by looking at the type of its
first constructor argument alone: automatic conversion rules might
need to be applied to that argument.
2023-11-29 08:58:47 +01:00
Jim Blandy
9d20784223
[naga wgsl-in] Reformat match statement for better patch stability.
...
The large `match` statement in `Lowerer::construct` seems to flop back
and forth between two indentation levels as it's edited, making the
diffs hard to read. Rewrite it to use deferred initialization of
`expr`, so that `cargo fmt` doesn't have to decide whether or not to
put the `match` on the same line as `let expr`. This makes subsequent
diffs easier to read.
2023-11-29 08:58:47 +01:00
Jim Blandy
e75fb3c224
[naga] Introduce Literal::AbstractInt
and AbstractFloat
.
...
Introduce new variants of `naga::Literal`, `AbstractInt` and
`AbstractFloat`, for representing WGSL abstract values.
2023-11-29 08:58:47 +01:00
Jim Blandy
276c978b70
[naga] Introduce ScalarKind::AbstractInt
and AbstractFloat
.
...
Introduce new variants of `naga::ScalarKind`, `AbstractInt` and
`AbstractFloat`, for representing WGSL abstract types.
2023-11-29 08:58:47 +01:00
Jim Blandy
48091784a1
[naga] Make the example_wgsl
test build without wgsl-in
feature.
2023-11-24 13:17:30 +01:00
Jim Blandy
86562e69a6
[naga] Support casting to f64 in the constant evaluator.
2023-11-23 12:17:21 +01:00
Jim Blandy
eb92ab2878
[naga wgsl] Experimental 64-bit floating-point literals.
...
In the WGSL front and back ends, support an `lf` suffix on
floating-point literals to yield 64-bit integer literals.
2023-11-23 12:17:21 +01:00
Connor Fitzgerald
06e9876adf
Move to A Single Example Executable ( #4756 )
...
* Move to combined examples
* Fix paths
* Curtail some tests
* Format
* Clippy
* Fix wasm
* Refactor main for wasm
* Style sheet
* Readme
* Lock
2023-11-23 05:26:42 -05:00
Jim Blandy
4f9cc288e3
[naga] Make compaction preserve named types, even if unused.
...
Have `compact::compact` preserve entries in the `Module::types` arena
if they have names.
Future abstract type support will require the WGSL front end to
compact the module before validation. Without this change, that will
drop `alias` declarations, making it harder to test type validation.
2023-11-22 18:33:59 +01:00
Jim Blandy
3f0465be59
[naga wgsl-in] Preserve type names in alias
declarations.
...
Given a WGSL `alias` declaration, create a Naga `Type` with the
alias's name, rather than dropping the type name on the floor.
2023-11-22 18:17:02 +01:00
Erich Gubler
1cf0fe841a
test(naga): add struct-layout
test
2023-11-22 03:54:16 -07:00
Erich Gubler
06b0a67551
chore(msl-out): remove outdated "quick and dirty" comment
2023-11-22 03:54:16 -07:00
Erich Gubler
a8da664773
chore(msl-out): should_pack_struct_member
: remove unnecessary alignment check for vec3
s
2023-11-22 03:54:16 -07:00
Erich Gubler
611da6da2d
fix(msl-out): emit and init struct
member padding always
...
Previously, implicit padding members of `struct`s were suppressed from
structure definitions in Metal output if they had a binding specified
for them (i.e., `@location(0)`). This padding is, however, is necessary
for correct access of member fields passed into shaders by uniform and
storage buffers. Unconditionally emit padding members for `struct`s.
Resolves
[`gfx-rs/wgpu`#4701](https://github.com/gfx-rs/wgpu/pull/4701 ).
2023-11-22 03:54:16 -07:00
Jim Blandy
dec907a771
[naga wgsl-in] Test hex float suffix handling corner case.
...
Test Naga's WGSL front end's handling of `h` and `f` suffixes on
hexadecimal float literals. WGSL permits these suffixes only if an
exponent is present, because otherwise `f` suffixes can be confused
with a hexadecimal digit.
2023-11-22 11:10:38 +01:00
Connor Fitzgerald
1df98d9888
Test And Normalize Vertex Behavior on All Backends ( #4723 )
...
Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2023-11-21 22:11:24 +00:00
Jim Blandy
a820a3ffba
[naga]: Make snapshot tests include paths in errors.
...
Following Rust convention, let `naga::front::wgsl::ParseError`'s
methods `emit_to_stderr_with_path` and `emit_to_string_with_path`
accept any `AsRef<Path>` argument as the path.
Pass input paths in snapshot tests, so that failures processing
shaders name the input file being processed.
2023-11-21 21:47:03 +01:00
Jim Blandy
104119a402
[naga] Fix type error in test.
...
Change the WGSL code in the `function_returns_void` test in
`tests/wgsl-errors.rs` so that the construction expression types
correctly. Subsequent iterations of the WGSL front end will be doing
some type checking earlier, to support WGSL's automatic conversions,
and without this fix, this test will stop checking what it is intended
to check.
2023-11-21 21:41:39 +01:00
Jim Blandy
72462267e8
[naga]: Let TypeInner::Matrix
hold a Scalar
, not just a width.
...
Let `naga::TypeInner::Matrix` hold a full `Scalar`, with a kind and
byte width, not merely a byte width, to make it possible to represent
matrices of AbstractFloats for WGSL.
2023-11-21 12:02:50 +01:00
dependabot[bot]
4b10ce7e5b
Bump serde from 1.0.192 to 1.0.193 ( #4736 )
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.192 to 1.0.193.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.192...v1.0.193 )
---
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>
2023-11-20 23:53:53 -05:00
Jim Blandy
42058cf24f
[naga] Add Literal::I64
, for signed 64-bit integer literals.
...
Add an `I64` variant to `crate::Literal`, making `crate::Expression`
suitable for representing `AbstractFloat` and `AbstractInt` values in
the WGSL front end.
Make validation reject uses of `Literal::I64` in constant and function
expression arenas unconditionally. Add tests for this.
Let the frontends and backends for languages that have 64-bit integers
read/write them.
2023-11-20 16:11:30 -08:00
Jim Blandy
fd53ea90e6
[naga] Let constant evaluation of As
preserve Splat
expressions.
...
When asked to evaluate an `Expression::As` cast applied to a `Splat`
expression, change `ConstantEvaluator::cast` to preserve the `Splat`,
rather than expanding it out to a `Compose` expression.
2023-11-17 16:20:11 -08:00
Jim Blandy
c9ae35edbb
[naga wgsl-in] Include base when printing pointer and array types.
...
When formatting `TypeInner::Pointer` and `TypeInner::Array` as WGSL
source code, bother to actually generate text for the target/element
type. This avoids producing ridiculous messages like:
> the type of `foo` is expected to be `array<unknown, 2>`, but got `array<unknown, 2>`
2023-11-17 23:36:15 +01:00
Teodor Tanasoaia
a26e4a009a
[naga] remove span
and validate
features ( #4706 )
2023-11-17 13:37:25 -05:00
Fredrik Fornwall
a5c93caa56
Add more metal keywords ( #4707 )
2023-11-17 17:02:36 +01:00
Jim Blandy
3ec547cdca
[naga] Preserve spans when compacting Arenas.
...
When compacting a module, properly adjust spans along with `Arena`
contents.
2023-11-16 22:50:54 +01:00
Jim Blandy
b7dd59e1dc
[naga] Let constant evaluation handle Compose
of Splat
.
...
When consuming a `Compose` expression that constructs a vector,
flatten `Splat` subexpressions out into their components.
Fixes #4581 .
2023-11-16 13:34:27 +01:00
dependabot[bot]
8870a085a8
Bump termcolor from 1.3.0 to 1.4.0 ( #4688 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-15 12:27:05 -05:00
Jim Blandy
ecb522e4e3
[naga] New tests for GLSL double-precision builtin functions.
2023-11-14 20:12:31 -08:00
Jim Blandy
16965f64e5
[naga wgsl-out] Correctly include width in matrix constructions.
...
When generating WGSL for an `Expression::Compose` constructing a
matrix, consult `TypeInner::Matrix::width` when writing the
type name in the construction expression, rather than just always
writing `matNxM<f32>`.
Fixes #4681 .
2023-11-14 20:12:31 -08:00
Jim Blandy
721e611b79
[naga glsl-in] Fix type of double ldexp's second arg.
...
The second argument of the GLSL `ldexp` builtin is always a 32-bit
integer or a vector of such, never a 64-bit integer. In
`inject_common_builtin`, that argument's type should not be influenced
by `float_width`.
Fixes #4680 .
2023-11-14 20:12:31 -08:00
Jim Blandy
324ec4a5ec
[naga glsl-in] Fix double overload for dot/reflect/distance/ldexp.
...
The first argument of the `dot`, `reflect`, `distance`, and `ldexp`
GLSL builtin functions may be either a float or a double, and thus the
argument type registered by `inject_common_builtin` must depend on the
`float_width` argument; it cannot simply be `Scalar::F32`.
Introduced by #4673 .
2023-11-14 20:12:31 -08:00
Jim Blandy
cf2405ca39
[naga wgsl-in] Use to_wgsl
functions everywhere appropriate.
...
Replace `ExpressionContext`'s methods `format_typeinner`,
`format_type`, and `format_type_resolution` with more `to_wgsl`
methods in the `naga::front::wgsl::to_wgsl` module.
2023-11-14 19:58:49 -08:00
Jim Blandy
941cd2e25c
[naga wgsl-in] Let TypeInner::to_wgsl take the context by reference.
2023-11-14 19:58:49 -08:00
Jim Blandy
cbb59c7bf3
[naga wgsl-in] Move all to_wgsl
functions into their own module.
...
This is code motion only, with minor doc fixes. There should be no
changes to the code.
2023-11-14 19:58:49 -08:00
Jim Blandy
a6aa3cd30d
[naga] Follow-ups to #4763 , Introduce Scalar
type to IR.
...
Clean up some things that should have been taken care of in the
original PR:
- Use `Scalar::float` helper.
- Use `Scalar` associated constants in match patterns.
- Use `Scalar`'s `PartialEq` implementation.
- Clean up identifier paths.
2023-11-14 21:42:38 +01:00
Jim Blandy
734e246e87
[naga] Improve algorithm for Module compaction.
...
Identify reachable function expressions, constant expressions, and
types using a single pass over each arena, taking advantage of the
fact that expressions and types may only refer to other entries that
precede them within their arena. Only walking the statement tree still
requires a worklist/recursion.
In addition to presumably being faster, this change slightly reduces
the number of non-comment lines of code in `src/compact`.
2023-11-14 11:18:43 -08:00
Jim Blandy
9f91c95c24
[naga] Introduce Scalar
type to IR.
...
Introduce a new struct type, `Scalar`, combining a `ScalarKind` and a
`Bytes` width, and use this whenever such pairs of values are passed
around.
In particular, use `Scalar` in `TypeInner` variants `Scalar`, `Vector`,
`Atomic`, and `ValuePointer`.
Introduce associated `Scalar` constants `I32`, `U32`, `F32`, `BOOL`
and `F64`, for common cases.
Introduce a helper function `Scalar::float` for constructing `Float`
scalars of a given width, for dealing with `TypeInner::Matrix`, which
only supplies the scalar width of its elements, not a kind.
Introduce helper functions on `Literal` and `TypeInner`, to produce
the `Scalar` describing elements' values.
Use `Scalar` in `wgpu_core::validation::NumericType` as well.
2023-11-14 14:21:27 +01:00
dependabot[bot]
01cb63c758
Bump serde from 1.0.191 to 1.0.192 ( #4652 )
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.191 to 1.0.192.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.191...v1.0.192 )
---
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>
2023-11-08 09:46:47 +01:00
dependabot[bot]
ba3d6898f1
Bump serde from 1.0.190 to 1.0.191 ( #4646 )
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.190 to 1.0.191.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.190...v1.0.191 )
---
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>
2023-11-07 12:12:05 +01:00
Connor Fitzgerald
7f72c9fc3b
Fix GL Push Constant Layout ( #4607 )
...
* It verks!
* More tests
* Fixes
* Working multi-stage push constants
* Comments
* Add push constant partial update teste
* Docs
* Update Cargo.toml
* Comments
2023-11-06 07:58:26 -05:00
Jim Blandy
267bd488d3
[naga wgsl-in] Introduce Scalar
type.
...
Introduce a new struct `Scalar`, holding a scalar kind and width, and
use it as appropriate in the WGSL front end. This consolidates
many (kind, width) pairs, and lets us name the two components.
Ideally, `Scalar` would be used throughout Naga, but this would be a large
change, touching hundreds of use sites. This patch begins by
introducing `Scalar` to the WGSL front end only.
2023-11-06 13:27:49 +01:00
Daniel McNab
7709010a79
Naga(msl): Clear named expressions after writing each function ( #4594 )
...
This appears to match other backends, and fixes
fix the case where expressions which were named in earlier
functions are used in local variable declarations
2023-11-02 18:46:36 +00:00
Jim Blandy
ea8b619ba4
Add some doc comments to naga::proc::constant_evaluator
.
2023-11-02 19:22:35 +01:00
Jim Blandy
e6063c5255
[wgsl-in] Replace TypedExpression
with a generic enum, Typed
.
...
Replace the `TypedExpression` struct, used to distinguish between WGSL
pointers and references since Naga has only `Pointer`, with an enum,
`Typed`, with variants for references and plain types. This cleans up
a bunch of code, since the struct's `is_reference` field basically
served as a detached enum discriminant. This also prepares the code
for adding abstract types.
2023-11-02 19:21:31 +01:00
dependabot[bot]
5661de7a3c
Bump arbitrary from 1.3.1 to 1.3.2 ( #4616 )
...
Bumps [arbitrary](https://github.com/rust-fuzz/arbitrary ) from 1.3.1 to 1.3.2.
- [Changelog](https://github.com/rust-fuzz/arbitrary/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rust-fuzz/arbitrary/compare/derive_arbitrary@1.3.1...v1.3.2 )
---
updated-dependencies:
- dependency-name: arbitrary
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-10-31 01:50:52 -04:00
Connor Fitzgerald
2a9fdf9aa1
Misc Repo Cleanup Tasks ( #4579 )
...
* Misc Repo Cleanup Tasks
* Dependency Trimming
* Dep cleanup
* Restrict libfuzzer
* Flip cfg
* mod fuzz
2023-10-27 00:15:51 -04:00
Jim Blandy
61bca7e0aa
wgsl-errors: Reverse "old" and "new" sides of diff output. ( #4577 )
...
When an error snapshot test fails and we generate a diff comparing the
expected output with the actual output, treat the expected output as
the diff "from", and the actual output as the diff "to" - not the
reverse.
2023-10-26 20:12:39 -04:00
Connor Fitzgerald
34e947de4b
Integration of Naga into Repo ( #4296 )
2023-10-25 16:51:36 -04:00
Connor Fitzgerald
5369eec3b2
Move naga to subfolder
2023-10-25 14:25:04 -04:00