282 Commits

Author SHA1 Message Date
Connor Fitzgerald
a356cb2026
Update Repo MSRV to 1.91 (#8678) 2025-12-07 21:52:35 -05:00
Connor Fitzgerald
5895de82b5
Rename push constants to immediates (#8586) 2025-12-01 15:20:02 +01:00
Andy Leiserson
6043b059c4
Tweak error behavior for unbalanced passes, and update CTS (#8543) 2025-11-18 11:18:17 -05:00
Andy Leiserson
71820eef20
Fix performance regression in bind group processing (#8519) 2025-11-14 00:10:42 -05:00
Andy Leiserson
e584f382e0 Store pointers instead of IDs when tracing (1/2)
This updates pass operations.

The trace player is temporarily broken.
2025-10-30 13:52:58 +01:00
Andy Leiserson
3ca6a1c0df Defer some bind group processing until draw/dispatch
This allows us to save some work when a bind group is replaced,
although WebGPU still requires us to fail a submission if any
resource in any bind group that was ever referenced during
encoding is destroyed.

Fixes #8399
2025-10-23 14:59:25 +02:00
Andy Leiserson
e8dfc72d04 Small refactors related to bind group tracking for compute passes
* Don't remove resources from the usage scope, it is not necessary, and
  not useful, since we don't verify the scope is empty afterwards.
* Avoid some unnecessary `unsafe`.
2025-10-23 14:59:25 +02:00
Andy Leiserson
3f7dae1a30
Additional api_logging for passes (#8326) 2025-10-13 13:19:29 -04:00
Andy Leiserson
1967900565
Encode commands on finish (#8220)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2025-09-25 14:22:51 -04:00
Andy Leiserson
04a3401638
Extract command encoding to free functions (#8210) 2025-09-11 15:15:33 -04:00
Andy Leiserson
d79a49a060 Rename commands to trace_commands 2025-09-11 10:20:03 -07:00
Andy Leiserson
718497356c Move enum Command from device::trace to command::encoder_command. 2025-09-11 10:20:03 -07:00
Andy Leiserson
885845087f Extract the parts of PassState that apply to the base encoder
And rename a few things.
2025-09-11 10:20:03 -07:00
Andy Leiserson
910143d622
Check for more cases of unbalanced debug groups (#8048)
Fixes #3911
2025-08-05 16:52:50 +02:00
Lucas Abel
b8c462ac31
[core] fix missing applies of DISCARD_HAL_LABELS (#7991) 2025-07-23 12:06:42 -04:00
teoxoy
b8c5c4add4 rename cmd_buf to cmd_enc where appropriate 2025-07-22 16:19:18 +02:00
teoxoy
63f3df86c8 [wgpu-core] split command encoders from command buffers 2025-07-22 16:19:18 +02:00
Kevin Reid
da6ccd5516 Fix undeclared base in profiling scopes.
This would cause compilation to fail if profiling was enabled.
2025-07-10 14:42:08 -04:00
Connor Fitzgerald
a248b8caf3 [core] Add RawResourceAccess trait 2025-07-09 18:08:11 -04:00
teoxoy
487f79ba44 Add missing device validity checks 2025-07-02 11:11:37 +02:00
Erich Gubler
964c5bbf4c feat(core): impl WebGpuError for API errors 2025-06-30 10:58:56 -04:00
Vecvec
27212104f8 Unify debug groups and markers. 2025-06-30 15:00:46 +02:00
Vecvec
6237dbf0b9 Unify timestamp writes. 2025-06-30 15:00:46 +02:00
Vecvec
afa96af76f Unify set push constants. 2025-06-30 15:00:46 +02:00
Vecvec
acd8cb18bb Unify rebinding resources. 2025-06-30 15:00:46 +02:00
Vecvec
4d36a02691 Unify set bind group. 2025-06-30 15:00:46 +02:00
Andy Leiserson
e936c065fc Additional comments on render and compute pass encoding 2025-06-26 15:39:53 -07:00
Andy Leiserson
fc26fbc561 Deferred error reporting for render passes 2025-06-26 15:39:53 -07:00
Andy Leiserson
460f073a67 Deferred error reporting for compute passes 2025-06-26 15:39:53 -07:00
Andy Leiserson
09c08037c9 Add a field in BasePass to store errors 2025-06-26 15:39:53 -07:00
Andy Leiserson
24f779696b
Tweak MapPassErr to work for both errors and results (#7780) 2025-06-10 10:26:36 -07:00
Andy Leiserson
77d2b0017a
Split EncoderStateError from CommandEncoderError (#7779) 2025-06-10 09:46:30 -07:00
Andy Leiserson
d9c4bf22ea
Panic on errors in pass_end_with_unresolved_commands (#7765) 2025-06-09 11:28:43 -07:00
Teodor Tanasoaia
78d05f5f71
[core] check that indirect buffers have not been destroyed (#7534) 2025-04-14 11:06:32 -04:00
Vecvec
8010203281 Rework acceleration structure build tracking. 2025-04-09 22:27:04 -04:00
teoxoy
7d15c511de move indirect validation code to its own folder
rename items appropriately
internalize indirect buffer bind groups
2025-03-26 18:26:31 +00:00
teoxoy
0285e60984 Replace the indirect-validation feature with InstanceFlags::VALIDATION_INDIRECT_CALL.
With the only caveat that device creation will now panic if the `wgsl` feature is not enabled, `InstanceFlags::VALIDATION_INDIRECT_CALL` is set and the device supports `DownlevelFlags::INDIRECT_EXECUTION`.
2025-03-26 18:26:31 +00:00
Bruce Mitchener
edd0ef80af
Fix clippy::manual_repeat_n lints (#7394) 2025-03-22 16:18:34 +00:00
Erich Gubler
8774ab53d5 chore: remove std::mem::* imports now unnecessary with CORE_MSRV
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](https://github.com/rust-lang/rust/pull/123168/).
2025-02-26 22:58:50 -05:00
Kevin Reid
7bcbfe0712 wgpu-core: Adjust imports to allow no_std.
Dependencies on `std` that still exist:
* Locks
* `std::error::Error` (waiting for Rust 1.81)
* `std::os::raw::c_char` for FFI
* `thread_local` and `Backtrace` in `snatch`
2025-02-21 08:47:16 +01:00
Erich Gubler
6a01091397 move(core): s/create_compute_pass/begin_compute_pass/ 2025-02-17 12:42:10 -05:00
Erich Gubler
7510d7b929 fix: add cbindgen:ignore on conflicting monomorphizations 2025-02-14 12:18:41 -05:00
sagudev
9db6430fdb ArcComputePassDescriptor
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-06 14:07:20 +01:00
JMS55
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
teoxoy
a5c3be575e remove device arg from all CommandEncoder methods 2024-12-20 15:44:15 +01:00
teoxoy
486967632c rename close to close_if_open and add close that panics if the encoder is not open 2024-12-20 15:44:15 +01:00
teoxoy
7a476fcbf4 use open_pass in some more places 2024-12-20 15:44:15 +01:00
atlv
5543961a71
Replace Range<T> with StateTransition<T> (#6703)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-12-11 16:11:39 +01:00
atlv
0b6571a68d
Align Storage Access enums to spec (#6642) 2024-12-03 17:37:23 +01:00
teoxoy
5e1fbd7176 move CommandEncoderStatus on the CommandBuffer and change its variants to hold CommandBufferMutable
This makes the code more straightforward, we were previously holding invalidity state in 2 places: `CommandBuffer::data` could hold `None` and in `CommandEncoderStatus::Error`.

This commit also implements `Drop` for `CommandEncoder` which makes the destruction/reclamation code automatic. We were previously not reclaiming all command encoders (`CommandBufferMutable::destroy` didn't call `release_encoder`) even though all encoders are coming from a pool.
2024-12-02 15:59:14 -08:00