Commit Graph
8897 Commits
Author SHA1 Message Date
@brody4hire - C. Jonathan Brody 8773d47c6d chore: remove obsolete entries from allow-git in .deny.toml (#7032) 2025-01-30 10:29:41 -05:00
@brody4hire - C. Jonathan Brody 7ff5009e27 chore: update noise -> 0.9 & remove from allow-git (#7033) 2025-01-30 09:35:58 +01:00
@brody4hire - C. Jonathan Brody 55c33b0372 update MapErrWithSpan to be pub(crate) trait 2025-01-29 20:22:56 -05:00
@brody4hire - C. Jonathan Brody a1185b21cc remove std::error::Error constraint not needed from AddSpan impl 2025-01-29 20:22:56 -05:00
@brody4hire - C. Jonathan Brody 58cbb93213 add blank lines & returned output type comment to MapErrWithSpan 2025-01-29 20:22:56 -05:00
@brody4hire - C. Jonathan Brody 1f2cc66f4e add blank lines & returned output type comment to AddSpan 2025-01-29 20:22:56 -05:00
@brody4hire - C. Jonathan Brody d7ed0c5290 keep internal AddSpan trait & impl together 2025-01-29 20:22:56 -05:00
@brody4hire - C. Jonathan Brody ea4d18c108 cleanup: resolve spelling errors in test comments (#7028) 2025-01-29 23:49:26 +00:00
@brody4hire - C. Jonathan BrodyandErich Gubler b8a5efc2f2 cleanup: CHANGELOG.md - resolve minor issues (#7024)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-29 15:34:19 -05:00
Jamie Nicol 6c8d0b061c [naga] Restore return statement at end of functions without return types (#7021) 2025-01-29 13:54:49 -05:00
Erich Gubler e0ebd1b266 diag(naga): clarify ImageStore type mismatch cases (#6791) 2025-01-29 11:13:36 -05:00
Jamie Nicol d9777355c9 [naga const_eval] Ensure eval_zero_value_and_splat() lowers a Splat of a ZeroValue correctly
eval_zero_value_and_splat() is called to lower ZeroValue and Splat
expressions into Literal and Compose expressions. However, in its
current form it either calls splat() *or* eval_zero_value_impl()
depending on the expression type.

splat() will lower a Splat of a scalar ZeroValue to a vector
ZeroValue, which means eval_zero_value_and_splat() can still return a
ZeroValue. Its callers, such as binary_op(), are unable to handle this
ZeroValue, so cannot proceed with const evaluation.

This patch makes it so that eval_zero_value_and_splat() will first
call splat(), *and then* call eval_zero_value_impl(), which will lower
the vector ZeroValue returned by splat() into a Compose of Literals.
Callers such as binary_op() are perfectly able to handle this Compose,
so can now proceed with const evaluation.
2025-01-29 06:55:48 -08:00
Jim Blandy 2a456f5c7b [naga] Move methods on TypeInner and friends into their own module. (#7018) 2025-01-28 19:47:40 -05:00
Erich Gubler 65d499f302 Clean up naga's xtask a bit (#7014) 2025-01-28 16:26:38 +00:00
Jamie Nicol b245b358f5 [naga] Don't treat Emit statements as return statements during ensure_block_returns() (#7013) 2025-01-28 10:48:40 -05:00
Jamie Nicol 34cfee6ebc [naga wgsl-in] Return error if wgsl parser recurses too deeply.
It's currently trivial to write a shader that causes the wgsl parser
to recurse too deeply and overflow the stack. This patch makes the
parser return an error when recursing too deeply, before the stack
overflows.

It makes use of a new function Parser::track_recursion(). This
increments a counter returning an error if the value is too high,
before calling the user-provided function and returning its return
value after decrementing the counter again.

Any recursively-called functions can simply be modified to call
track_recursion(), providing their previous contents in a closure as
the argument. All instances of recursion during parsing call through
either Parser::statement(), Parser::unary_expression(), or
Parser::type_decl(), so only these functions have been updated as
described in order to keep the patch as unobtrusive as possible.

A value of 256 has been chosen as the recursion limit, but can be
later tweaked if required. This avoids the stack overflow in the
testcase attached to issue #5757.
2025-01-28 15:00:26 +00:00
Connor Fitzgerald d6904a70a5 Remove Incorrect Emcripten Instructions (#7010) 2025-01-28 13:25:25 +01:00
Kevin Reid 98e080410f Fix compatibility issues in hello_window example. (#7009) 2025-01-27 12:14:20 -05:00
Kevin Reid 321ee42771 Don’t copy buffer data back to JS if unnecessary, in WebGPU backend. (#7007) 2025-01-27 12:14:09 -05:00
metamuffin 33e8df0f44 Fix deadlock between snatchable_lock and trackers in Queue::write_texture (#7004)
* Fix deadlock between snatchable_lock and trackers in Queue::write_texture

* Fix another deadlock in write_texture between pending_writes and snatchable_lock.
2025-01-27 18:01:57 +01:00
@brody4hire - C. Jonathan BrodyandConnor Fitzgerald df54acc05d use hashbrown in more crates (etc.) (#6938)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 11:50:33 -05:00
Daniel McNab fcbadc9529 Link to TextureBlitterBuilder from TextureBlitter::new (#7003) 2025-01-27 11:30:26 +01:00
dependabot[bot] 7e4cfb5947 chore(deps): bump web-time from 0.2.4 to 1.1.0 (#7001)
Bumps [web-time](https://github.com/daxpedda/web-time) from 0.2.4 to 1.1.0.
- [Release notes](https://github.com/daxpedda/web-time/releases)
- [Changelog](https://github.com/daxpedda/web-time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/daxpedda/web-time/compare/v0.2.4...v1.1.0)

---
updated-dependencies:
- dependency-name: web-time
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-26 23:05:33 -05:00
dependabot[bot] a5491c4484 chore(deps): bump the patch-updates group with 8 updates (#7000)
Bumps the patch-updates group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [trybuild](https://github.com/dtolnay/trybuild) | `1.0.102` | `1.0.103` |
| [clap](https://github.com/clap-rs/clap) | `4.5.26` | `4.5.27` |
| [clap_builder](https://github.com/clap-rs/clap) | `4.5.26` | `4.5.27` |
| [crunchy](https://github.com/eira-fransham/crunchy) | `0.2.2` | `0.2.3` |
| [is-terminal](https://github.com/sunfishcode/is-terminal) | `0.4.13` | `0.4.15` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.43` | `0.38.44` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.14` | `1.0.15` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.12.0` | `1.12.1` |


Updates `trybuild` from 1.0.102 to 1.0.103
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.102...1.0.103)

Updates `clap` from 4.5.26 to 4.5.27
- [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.26...clap_complete-v4.5.27)

Updates `clap_builder` from 4.5.26 to 4.5.27
- [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.26...v4.5.27)

Updates `crunchy` from 0.2.2 to 0.2.3
- [Commits](https://github.com/eira-fransham/crunchy/commits)

Updates `is-terminal` from 0.4.13 to 0.4.15
- [Commits](https://github.com/sunfishcode/is-terminal/compare/v0.4.13...v0.4.15)

Updates `rustix` from 0.38.43 to 0.38.44
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.43...v0.38.44)

Updates `unicode-ident` from 1.0.14 to 1.0.15
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.14...1.0.15)

Updates `uuid` from 1.12.0 to 1.12.1
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.12.0...1.12.1)

---
updated-dependencies:
- dependency-name: trybuild
  dependency-type: direct:production
  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_builder
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: crunchy
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: is-terminal
  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: unicode-ident
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: uuid
  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-01-26 23:05:10 -05:00
ed-2100andConnor Fitzgerald 36ccc9fc1d Fix surface drop order. (#6997)
* Fix surface drop order.

* Add changes to changelog.

* Update SAFETY note.

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

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-26 22:23:51 -05:00
dependabot[bot] 4bb9c396ce chore(deps): bump actions/checkout from 2 to 4 (#6998)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 02:30:41 +00:00
Dennis LonoshchukandConnor Fitzgerald 0e7d93ed92 Adds hello window example (#6992)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-27 02:08:52 +00:00
Connor Fitzgerald b233d204f7 Fix Hello Compute Shader (#6985) 2025-01-24 18:26:49 +00:00
Reina_Sakiria 5386d38113 [naga spv-in] OpImageWrite allows input other than Vector4. (#6630)
* fix(naga-spv-in): Image write value type is invalid.

* fix(naga-spv-in): input vector 4 may case error

* fix(naga-spv-in): Incorrect swizzle pattern for vector size 3.
2025-01-24 16:59:58 +01:00
0fc0b35899 Transition resources (#6678)
* WIP

* Fix typo

* WIP: Implement structure of  command_encoder_transition_resources

* WIP

* More work

* Clippy

* Fix web build

* Use new types for API, more docs

* Add very basic test

* Try to fix test cfg

* Fix merge

* Missed commit

* Use wgt types instead of hal types

* Implement `Clone` for `ShaderModule` (#6939)

* Move to dispatch trait, move more things to wgt

* Move existing code to use new wgt types

* Fixes

* Format import

* Format another file

* Fixes

* Make module private

* Fix imports

* Fix test imports

* Rexport types

* Fix imports

* Fix import

---------

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-01-24 00:54:19 -05:00
Connor Fitzgerald d8e7ab1ad1 Refactor Cargo.toml Significantly (#6980) 2025-01-23 22:49:48 +00:00
SamsonandErich Gubler 04aff59a14 [naga] implement pointer_composite_access WGSL language extension (#6913)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2025-01-23 13:29:17 -05:00
Teodor Tanasoaia a8bd1fe1ac [d3d12] bound check dynamic buffers (#6931)
To achieve this for dynamic storage buffers we changed the way we bind them. They now go in root tables and we pass the offset via a root constant.
2025-01-23 17:18:36 +00:00
Kent Slaney 3cd2e7caf0 [naga] Remove unused types and global expressions in a single pass.
In compaction, correctly identify unused types and global expressions,
rather than treating all global expressions referred to by
`PendingArraySize::Expression` array lengths as used even if the array
type itself is not.

This is tested by checking that going from expression to type and
back, along with the opposite, is correctly marked as used. It also
checks that adding an unused type using an expression gets compacted
out.

See the comments on `ModuleTracer::type_expression_tandem` for
details.

Fixes #6788.
2025-01-23 08:11:18 -08:00
Jamie Nicol 0282d61f91 [naga hlsl-out] Handle array types for function return values and calls (#6971) 2025-01-23 16:56:18 +01:00
Daniel McNab 5e2bcc9191 Improve the docs of PipelineCache and friends (#6978) 2025-01-23 11:56:05 +01:00
Jim Blandy e86ed8b6c8 [naga] Document arena ordering requirements. 2025-01-22 19:33:05 -08:00
Connor Fitzgerald 3dd925b697 Use Bitflags Unknown Bit Check (#6967) 2025-01-21 21:41:38 -05:00
Connor Fitzgerald da3c15b49d Debug Management 2025-01-21 13:16:03 -08:00
Connor Fitzgerald 23119b1eeb Cleanup CI Jobs 2025-01-21 13:16:03 -08:00
Connor Fitzgerald a1fc4a0316 Allow Short Circuting GL Fences (#6942) 2025-01-21 19:28:14 +00:00
Connor Fitzgerald 436f716715 Unconditionally Generate Bindless Samplers in DX12 (#6766) 2025-01-21 14:24:03 -05:00
Alphyr 2298cd2dd6 Remove additional trait impls from CommandBuffer (#6960) 2025-01-21 16:33:07 +00:00
Connor Fitzgerald 04e40dd135 Update Vulkan SDK (#6955) 2025-01-21 00:12:07 +00:00
Connor Fitzgerald 7fccb6bdb9 Standalone Compute
Fix Generate

Fix?

17th Time's The Charm

Fix Build

See Eye

Docs

Victory Tabular

Formatting

Formating3
2025-01-20 18:07:22 -05:00
Connor Fitzgerald 43b6637754 Remove Hello Example 2025-01-20 18:07:22 -05:00
Connor Fitzgerald c73bd2fa60 Move Examples to Subfolder 2025-01-20 18:07:22 -05:00
Connor Fitzgerald 4ed5021996 Ban Dynamic Offsets and Binding Arrays in the Same Bind Group (#6811)
* Ban Dynamic Offsets and Binding Arrays in the Same Bind Group

* Add Tests and Uniform Buffer Restriction
2025-01-20 13:28:32 -05:00
b626020769 [naga] parse and validate @must_use attribute (#6801)
* feat: parse and enforce `@must_use` attribute

* feat: refuse `@must_use` of void function

* generated naga/tests/out/ir

* revert extraneous changes

* fix clippy

* update repeated attribute error to trunk format

* struct members can't have `@must_use`

* review fixes

* Remove must_use from FunctionResult and revert the related changes

---------

Co-authored-by: turbocrime <turbocrime@users.noreply.github.com>
Co-authored-by: Jamie Nicol <jnicol@mozilla.com>
2025-01-20 18:09:36 +00:00
Andreas Reich 426c1d364f Fix missing wgt re-export on wgpu for CopyExternalImageDestInfo (#6962) 2025-01-20 18:00:34 +00:00