Commit Graph
10233 Commits
Author SHA1 Message Date
Andy Leiserson a24965f8b7 fix(naga): Coerce matrix initializers to concrete floats (#8817) 2026-01-29 18:00:26 -08:00
Andy LeisersonandJim Blandy 70a7f83ea8 naga: Enforce @must_use for built-in functions (#8713)
---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2026-01-29 15:03:29 -08:00
Sam f7ce2a0052 wgpu: Relese map_context lock before map_async closure call (#8966) 2026-01-29 14:49:51 -05:00
Vecvec 8a37e0f56a [wgsl in and IR] naga ray tracing pipelines (#8570) 2026-01-29 14:18:56 -05:00
Erich Gubler c0c7aafe1b docs(CHANGELOG): nest unreleased Changes > General section properly (#8965) 2026-01-29 18:14:08 +00:00
Kevin Reid b0a5da442e Make internal-use hidden macros crate-private instead. (#8961) 2026-01-29 12:38:54 -05:00
Timo KöstersandErich Gubler b93bab52bc feat: support blendable f32 textures on vulkan (#8963)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-01-29 17:07:22 +00:00
Inner Daemons c82e37b683 Validate pipelines with passthrough shaders but no explicit layout passed (#8881) 2026-01-28 20:14:33 -05:00
Timo Kösters db8270e3bc docs: clarify bytes_per_row requirement (#8959) 2026-01-28 23:03:33 +00:00
Andy Leiserson b512f7e36f test(naga): Tests for mesh shader extension validation (#8871) 2026-01-28 16:36:30 -05:00
renovate[bot] 7717c87f28 chore(deps): update rust crate glam to 0.31.0 (#8928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-28 16:34:10 -05:00
Vecvec f3b5243db7 Refactor build_acceleration_structures to require fewer passes (#8904) 2026-01-28 16:14:28 -05:00
Sam 2d2b109111 wgpu: Require Drop on *PassInterface and remove end from it (#8851) 2026-01-28 15:55:59 -05:00
Erich Gubler e816bd7ed4 build: add cargo component to rust-toolchain.toml
I noticed that when I force-updated the toolchain being used for wgpu,
I got an error about the `cargo` binary not being available after
redirecting a naive `cargo` invocation to the set of binaries for the
1.93 toolchain. This fixes that issue.
2026-01-28 15:42:38 -05:00
Erich Gubler 487afd21e4 chore: update REPO_MSRV 1.92 → 1.93 2026-01-28 15:42:38 -05:00
Erich Gubler 59c351be6a refactor: satisfy clippy::unnecessary_unwrap
New in Rust 1.93! Reference:
[`clippy::unnecessary_unwrap`](https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_unwrap)
2026-01-28 15:42:38 -05:00
Erich Gubler 33a91d4ada refactor(spv-out): subvert-replace "recycle" in trait Recyclable to "reclaim"
This avoids `rustc` errors new to Rust 1.93. These errors are because
`Recyclable::recycle` triggers the `unstable_name_collisions` lint on
use, detecting a collision with the unstable `vec_recycle` Nightly
feature.
2026-01-28 15:42:38 -05:00
Jim Blandy 1add139b75 [naga wgsl-in] Consolidate bitcast and coopLoad handling.
In `naga::front::wgsl::lower::Lowerer::call_builtin`, consolidate the
cases for `bitcast`, `coopLoad`, and `coopLoadT` with the other
miscellaneous builtin functions.
2026-01-28 12:36:21 -08:00
Jim Blandy 7b473a7aba [naga wgsl-in] Move builtin function calls into their own fn.
Move the code for handling calls to WGSL builtin functions out of
`Lowerer::call` and into its own new function,
`Lowerer::call_builtin`, for clarity. Do template parameter list
finalization in the caller.
2026-01-28 12:36:21 -08:00
Jim Blandy 6abcc54ee1 [naga wgsl-in] In Lowerer::call, handle constructors first.
Rearrange `naga::front::wgsl::lower::Lowerer::call` to check
for construction expressions for predeclared types before checking for
any builtin function names, including those that take template
parameter lists like `bitcast` and `coopLoad`.
2026-01-28 12:36:21 -08:00
Erich Gubler b285d3f9bb Restrict several internal Naga APIs to pub(crate) (#8956) 2026-01-28 17:45:53 +01:00
Andy Leiserson 7e5f016ca7 chore(cts): Enable test fixed by objc2 (#8950)
Closes #7357
2026-01-28 07:56:16 -08:00
Jim Blandy 66f95269b5 [naga wgsl-in]: Rename error variant field for clarity.
Rename `naga::front::wgsl::error::Error::MissingTemplateArg::arg` to
`description`, to make it a little more specific.
2026-01-28 12:00:35 +01:00
Jim Blandy 63d6c34859 [naga wgsl-in] Flatten control flow for clarity.
Adjust some methods of `TemplateListIter` to ensure that the typical
complete control flow through the function follows the outermost
nesting level.
2026-01-28 12:00:35 +01:00
Jim Blandy 81a1e8d3cf [naga wgsl-in] Don't permit template parameters after enumerants. 2026-01-28 12:00:35 +01:00
Jim Blandy 7b3c7f7da7 [naga] Simplify proc::Namer's handling of struct member names.
Rather than passing `call_impl` an `ignore_builtin_identifiers` flag
and plumbing that through from its points of use, extend
`Namer::namespace` to suspend the `builtin_identifiers` table, as it
does for `unique` already. The resulting behavior is the same.
2026-01-28 12:00:35 +01:00
Jim Blandy 85bd8b45bd [naga wgsl-in] Doc fixes. 2026-01-28 12:00:35 +01:00
Jim Blandy 71f186a032 [naga wgsl-in] Minor rearrangement to flatten control flow.
Use `if let`, `let else`, and `Option` methods to reduce nesting and
clarify success paths.
2026-01-28 12:00:35 +01:00
Jim Blandy 555bc09017 [naga wgsl-in] Use typical abbreviations in map_predeclared_type. 2026-01-28 12:00:35 +01:00
teoxoy 307f1fb697 [wgsl-in] move enumerant & var_address_space functions on ExpressionContext 2026-01-28 12:00:35 +01:00
Jim Blandy 2737e9e0ca [naga wgsl-in] Doc fixes.
- Clarify that various `foo_statement` functions on `Parser` do not
  consume the statement's final `;`.

- Various other doc fixes throughout.
2026-01-28 12:00:35 +01:00
Jim Blandy 5217dbdfa3 [naga wgsl-in] Rename TemplateListIter::scalar to scalar_ty.
The name `scalar` suggests that it returns a scalar value, and
`scalar_ty` is analogous to `ty`.
2026-01-28 12:00:35 +01:00
Jim Blandy 0c77a1f6ca [naga wgsl-in] Remove unnecessary dependencies.
Avoid adding entries to `ExpressionContext::unresolved` for
identifiers that `ExpressionContext::ident_expr` has already
processed.

At the moment, there is no way these could cause a bug: they only
occur after we've recognized a call/construction expression, and those
can never refer to function-local definitions, so the string in
question is certain to have already been added to `unresolved` by
`ExpressionContext::ident_expr`. But they're redundant, and if Naga
ever supported nested functions or local type aliases, these could end
up adding extraneous dependencies.
2026-01-28 12:00:35 +01:00
Jim Blandy ada7681067 [naga wgsl-in] Rename consume_tokens to discover_template_lists. 2026-01-28 12:00:35 +01:00
Jim Blandy 1ef660f133 [naga wgsl-in] Use Option::is_some_and where appropriate. 2026-01-28 12:00:35 +01:00
Jim Blandy c7a43a2e9f [naga wgsl-in] Rename component_or_swizzle_specifier arg.
In `naga::front::wgsl::parse::Parser::component_or_swizzle_specifier`,
since `span_start` sounds like the start of a span, rename that
argument to `expr_start`, since it is the span of the start of the
expression that ends with the component or swizzle specifier.
2026-01-28 12:00:35 +01:00
teoxoy 94cc5187dd [wgsl] pass expected token to functions that might not match any tokens
This improves errors making them more general where appropriate.
2026-01-28 12:00:35 +01:00
teoxoy ac18c06ba6 [wgsl-out] avoid shadowing built-ins 2026-01-28 12:00:35 +01:00
teoxoy 34ab7363ef adjust GLSL snapshots 2026-01-28 12:00:35 +01:00
teoxoy 563309c299 document consume_tokens 2026-01-28 12:00:35 +01:00
teoxoy 8ad20b247b add test_template_list test 2026-01-28 12:00:35 +01:00
teoxoy 2dffab15bf add shadowing_predeclared_types test 2026-01-28 12:00:35 +01:00
teoxoy 1ef831ad2c handle all type resolution in the lowerer 2026-01-28 12:00:35 +01:00
teoxoy cb401cef90 handle bitcast, coopLoad and construction exprs in the lowerer 2026-01-28 12:00:35 +01:00
teoxoy 514d0e743d handle var decl template list in the lowerer 2026-01-28 12:00:35 +01:00
teoxoy cfd3434f83 add TemplateArgsStart & TemplateArgsEnd tokens 2026-01-28 12:00:35 +01:00
teoxoy c20919c5ee [wgsl] update reserved list to latest CR 2026-01-28 12:00:35 +01:00
teoxoy 17e3d2e2f2 implement template list discovery 2026-01-28 12:00:35 +01:00
teoxoy 1a49dbfa19 add Lexer::span_with_start 2026-01-28 12:00:35 +01:00
teoxoy 626f5514b6 remove Clone derive from the Lexer
also fixes spans in some cases
2026-01-28 12:00:35 +01:00