Commit Graph

9154 Commits

Author SHA1 Message Date
Andy Leiserson
be16f8ce18 Use ty.for_debug 2025-04-09 08:15:47 -07:00
Andy Leiserson
d223bb582f [naga] Disallow logical operators && and || on vectors
Fixes #6856
2025-04-09 08:15:47 -07:00
Sylvain Benner
14690470bb
[metal] Metal compute shader passthrough (#7326)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-04-09 14:25:41 +00:00
Connor Fitzgerald
3ba97bc3b7
Fix CI flakes (#7491) 2025-04-08 11:15:31 -04:00
Connor Fitzgerald
a6d7e0d56b [d3d12] Move naming inside suballocation functions 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
a1e96cc179 [d3d12] Simplify set_name calls with a helper 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
6262462979 [d3d12] Make placed/committed resource paths the same 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
1831267551 [d3d12] Separate placed resource construction into separate functions 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
460eff4866 [d3d12] Always associate a size with an allocation 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
014b5b52f2 [d3d12] Internalize raw buffer desc mapping 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
4fce269b1d [d3d12] Isolate buffer descriptor mapping 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
b57ec2c9e0 [d3d12] Remove unused visibility and arguments 2025-04-07 21:03:43 -04:00
Connor Fitzgerald
004961874f [d3d12] Turn suballocation free functions into member functions 2025-04-07 21:03:43 -04:00
Jim Blandy
b5f6547934
[naga] Exhaustively match MathFunction in the constant evaluator. (#7487) 2025-04-07 16:54:15 -04:00
Jim Blandy
a611f72e56 [naga wgsl-in] Move Expression::Math construction into a helper.
In `naga::front::wgsl`, add a new helper method,
`Lowerer::math_function_helper`, that constructs `Expression::Math`
expressions for calls to `MathFunction` builtins. Use this helper in
`Lowerer::call`.
2025-04-07 16:53:50 -04:00
Jim Blandy
b9ac282518 [naga wgsl-in] In Lowerer, rename some argument types.
Since we have moved some code out into separate functions, we have
less context to compete with, so we can use simpler names for the
arguments.

This commit is just renaming.
2025-04-07 16:53:50 -04:00
Jim Blandy
10145efed4 [naga wgsl-in] In Lowerer, abstract out overload resolution.
In `naga::front::wgsl::lower::Lowerer`, add a new helper method,
`resolve_overloads`, that selects the appropriate rule for a given
list of of arguments from an overload set.

Use this helper in the `call` method when building `Math`
expressions.

This is just code motion, and should have no effect on behavior.
2025-04-07 16:53:50 -04:00
Jim Blandy
f7dde7e9a0 [naga wgsl-in] In Lowerer, add helper for automatic conversions.
In `naga::front::wgsl::lower::Lowerer`, add a new helper method,
`apply_automatic_conversions_for_call`, that applies the conversions
necessary to pass a given set of arguments to a given overload.

Use this helper in the `call` method when building `Math`
expressions.

This is just code motion, and should have no effect on behavior.
2025-04-07 16:53:50 -04:00
Jim Blandy
62e0272537 [naga wgsl-in] In Lowerer, expand role of lowered arguments vector.
In `naga::front::wgsl::lower::Lowerer::call`, when building `Math`
expressions, use `lowered_arguments` for both the original Naga IR
argument expressions and their counterparts after applying automatic
conversions.

This is a minor refactor that prepares for later cleanups.
2025-04-07 16:53:50 -04:00
Jim Blandy
fc1ebc481d [naga wgsl-in] In Lowerer, rename unconverted_arguments.
In `naga::front::wgsl::lower::Lowerer::call`, when building `Math`
expressions, rename `unconverted_arguments` to `lowered_arguments`.

No change to behavior. This is a minor refactor that prepares for
later cleanups.
2025-04-07 16:53:50 -04:00
Jim Blandy
c50f8c32ea [naga wgsl-in] In Lowerer, check arity with unconverted_arguments.
In `naga::front::wgsl::lower::Lowerer::call`, when building `Math`
expressions, use `unconverted_arguments` to check the number of
arguments to the call. This means that `arguments` is never used in
this branch once we have built `unconverted_arguments`.

This is a minor refactor that prepares for later cleanups.
2025-04-07 16:53:50 -04:00
Jim Blandy
f06ba9a528 [naga wgsl-in] In Lowerer::call, prefer unconverted_arguments.
In `naga::front::wgsl::lower::Lowerer::call`, when building `Math`
expressions, replace some uses of the `arguments` vector with
uses of `unconverted_arguments`.

This is a minor refactor that prepares for later cleanups.
2025-04-07 16:53:50 -04:00
Jim Blandy
20c2f8d8c1 [naga wgsl-in] In Lowerer::call, precompute unconverted arg list.
In `naga::front::wgsl::lower::Lowerer::call`, when building `Math`
expressions, build the vector of lowered but not yet converted
argument expressions completely before starting overload resolution.
Then iterate over those lowered arguments, not the ast arguments.

This is a minor refactor that prepares for later cleanups.
2025-04-07 16:53:50 -04:00
Jim Blandy
dec819899a [naga wgsl-in] Minor cleanup to math function lowering.
In `naga::front::wgsl::lower::Lowerer::call`, use only the
`unconverted_arguments` vector, rather that using both `arguments` and
`unconverted_arguments`.
2025-04-07 16:53:50 -04:00
Erich Gubler
1b51f0aa40 feat(naga): add UnimplementedEnableExtension::Subgroups 2025-04-07 11:48:41 -07:00
Erich Gubler
b7711e56ad refactor(naga): order ImplementedEnableExtension::F16 first 2025-04-07 11:48:41 -07:00
dependabot[bot]
cd81063aef
chore(deps): bump the patch-updates group with 11 updates (#7485)
Bumps the patch-updates group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.11.7` | `0.11.8` |
| [smallvec](https://github.com/servo/rust-smallvec) | `1.14.0` | `1.15.0` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.44.1` | `1.44.2` |
| [petgraph](https://github.com/petgraph/petgraph) | `0.7.1` | `0.8.0` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.17` | `1.2.18` |
| [clap](https://github.com/clap-rs/clap) | `4.5.34` | `4.5.35` |
| [clap_builder](https://github.com/clap-rs/clap) | `4.5.34` | `4.5.35` |
| [errno](https://github.com/lambda-fairy/rust-errno) | `0.3.10` | `0.3.11` |
| [foldhash](https://github.com/orlp/foldhash) | `0.1.4` | `0.1.5` |
| [prettyplease](https://github.com/dtolnay/prettyplease) | `0.2.31` | `0.2.32` |
| [quick-xml](https://github.com/tafia/quick-xml) | `0.37.3` | `0.37.4` |


Updates `env_logger` from 0.11.7 to 0.11.8
- [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.11.7...v0.11.8)

Updates `smallvec` from 1.14.0 to 1.15.0
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.14.0...v1.15.0)

Updates `tokio` from 1.44.1 to 1.44.2
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

Updates `petgraph` from 0.7.1 to 0.8.0
- [Release notes](https://github.com/petgraph/petgraph/releases)
- [Changelog](https://github.com/petgraph/petgraph/blob/master/CHANGELOG.md)
- [Commits](https://github.com/petgraph/petgraph/compare/petgraph@v0.7.1...petgraph@v0.8.0)

Updates `cc` from 1.2.17 to 1.2.18
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.17...cc-v1.2.18)

Updates `clap` from 4.5.34 to 4.5.35
- [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/clap_complete-v4.5.34...clap_complete-v4.5.35)

Updates `clap_builder` from 4.5.34 to 4.5.35
- [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.34...v4.5.35)

Updates `errno` from 0.3.10 to 0.3.11
- [Release notes](https://github.com/lambda-fairy/rust-errno/releases)
- [Changelog](https://github.com/lambda-fairy/rust-errno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lambda-fairy/rust-errno/compare/v0.3.10...v0.3.11)

Updates `foldhash` from 0.1.4 to 0.1.5
- [Commits](https://github.com/orlp/foldhash/compare/v0.1.4...v0.1.5)

Updates `prettyplease` from 0.2.31 to 0.2.32
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.31...0.2.32)

Updates `quick-xml` from 0.37.3 to 0.37.4
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/compare/v0.37.3...v0.37.4)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-version: 0.11.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: smallvec
  dependency-version: 1.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: petgraph
  dependency-version: 0.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: patch-updates
- dependency-name: cc
  dependency-version: 1.2.18
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: clap
  dependency-version: 4.5.35
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: clap_builder
  dependency-version: 4.5.35
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: errno
  dependency-version: 0.3.11
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: foldhash
  dependency-version: 0.1.5
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: prettyplease
  dependency-version: 0.2.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: quick-xml
  dependency-version: 0.37.4
  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>
2025-04-07 13:11:14 -04:00
dependabot[bot]
56ef24fcdd
chore(deps): bump crate-ci/typos from 1.31.0 to 1.31.1 (#7483)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.31.0 to 1.31.1.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.31.0...v1.31.1)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.31.1
  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>
2025-04-07 10:10:44 -04:00
Connor Fitzgerald
46ef1fc061 [d3d12] Use DeviceAllocationContext for deallocation 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
cccb0864cd [d3d12] Import suballocation module instead of subtypes 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
b2160813c5 [d3d12] Pass resource into free_allocation 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
840dbd5385 [d3d12] Improve naming of allocation functions 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
0f4d1f2284 [d3d12] Internalize Allocation option 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
f895290550 [d3d12] Rename AllocationWrapper to Allocation 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
c946ab2052 [d3d12] Remove GpuAllocatorWrapper 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
595b3eb647 [d3d12] Use DeviceAllocationContext for memory allocation 2025-04-07 16:01:19 +02:00
Connor Fitzgerald
74b37916db [d3d12] Move private_capabilities to DeviceShared 2025-04-07 16:01:19 +02:00
Vecvec
e8e66afb72
Fix new acceleration structure building validation errors. (#7486) 2025-04-07 15:17:06 +02:00
Andy Leiserson
a843c880d2
[metal] Fix handling of stage visibility for binding arrays (#7479)
Fixes #7287
2025-04-04 11:20:57 -04:00
Connor Fitzgerald
211d2ec0f3
Backport v24 changelogs (#7477) 2025-04-04 10:11:13 +02:00
Connor Fitzgerald
923055b9d8
Update release checklist (#7478)
Just a small thing I found
2025-04-04 10:10:15 +02:00
Andy Leiserson
110d737570
[naga msl-out] Fix truncation of pulled vertices (#7458)
Fixes #7410
2025-04-03 10:27:35 -07:00
Connor Fitzgerald
c860a2cf8c
Rename and unsafe start_capture -> start_graphics_debugger_capture (#7470)
* Improve `start_capture` docs

* Docs
2025-04-03 13:07:22 -04:00
Connor Fitzgerald
eea54c221c
Delete naga snapshots in CI (#7469) 2025-04-03 15:53:34 +00:00
Connor Fitzgerald
f7bcc6294f
Prefix snapshot outputs with input language (#7414) 2025-04-03 15:08:23 +00:00
Connor Fitzgerald
c344bec508 Comments 2025-04-03 10:35:20 -04:00
Connor Fitzgerald
6a986f4bc4 Timestamp normalization 2025-04-03 10:35:20 -04:00
Jim Blandy
7da699608d [naga] Support MathFunction overloads correctly.
Define a new trait, `proc::builtins::OverloadSet`, for types that
represent a Naga IR builtin function's set of overloads. The
`OverloadSet` trait includes operations needed to validate calls,
choose automatic type conversions, and generate diagnostics.

Add a new function, `ir::MathFunction::overloads`, which returns the
given `MathFunction`'s set of overloads as an `impl OverloadSet`
value. Use this in the WGSL front end, the validator, and the
typifier.

To support `MathFunction::overloads`, provide two implementations
of `OverloadSet`:

- `List` is flexible but verbose.

- `Regular` is concise but more restrictive.

Some snapshot output is affected because `TypeResolution::Handle`
values turn into `TypeResolution::Value`, since the function database
constructs the return type directly.

To work around #7405, avoid offering abstract-typed overloads of some
functions.

This addresses #6443 for `MathFunction`, although that issue covers
other categories of operations as well.
2025-04-02 18:27:19 -04:00
Jim Blandy
8292949478 [naga] Introduce ForDebug and ForDebugWithTypes traits
Introduce traits to add `for_debug` methods to Naga IR types that can
be formatted with `core::fmt::Debug`, given adequate context.
2025-04-02 18:27:19 -04:00
Jim Blandy
d19e3b2b3e [naga wgsl-in] Minor doc fix. 2025-04-02 18:27:19 -04:00