Commit Graph
84 Commits
Author SHA1 Message Date
Andy Leiserson d152e7369b Reduce binary bloat from error vtables (#9149) 2026-03-04 08:52:24 -08:00
Erich Gubler 9bc127f128 chore: update CORE_MSRV to 1.90 (#8943)
New cases for some Clippy lints pop up as part of this upgrade that
cannot be done before, listed below. Yuck!

- `clippy::manual_is_multiple_of`
- `clippy::missing_const_for_fn`
- `clippy::useless_nonzero_new_unchecked`
2026-01-27 19:37:10 -05:00
Teodor Tanasoaia d41e43bc60 [wgpu-core] validate occlusion and pipeline statistics queries end (#8684) 2025-12-08 18:42:26 +01: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 LeisersonandAndreas Reich 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
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
Erich Gubler 166c2ea2aa fix(core): check query set index before other validation (#7908) 2025-07-10 19:04:37 +00: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
Andy Leiserson 3a5d0f2747 Deferred error reporting for other command encoder operations
* clear commands
* query set functions
* command_encoder_as_hal_mut
* ray_tracing
2025-06-17 16:17:43 -07:00
Andy Leiserson 77d2b0017a Split EncoderStateError from CommandEncoderError (#7779) 2025-06-10 09:46:30 -07: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
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
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
Erich Gubler 3b3e1939f9 Eliminate overflow in query set bounds checks (#6933) 2025-01-17 16:36:22 +00:00
teoxoy a5c3be575e remove device arg from all CommandEncoder methods 2024-12-20 15:44:15 +01:00
teoxoy 02b28e28f0 use EncoderGuard for the other command encoder operations
The spec requires us to invalidate the encoder if there was any error during the body of these operations.
2024-12-02 15:59:14 -08: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
Erich Gubler 6365e2dd75 fix(core): validate dst_buffer isn't destroyed when resolving query sets 2024-11-21 23:23:15 -05:00
Erich Gubler be50bdfc18 fix(core): validate bounds of pass timestamp writes' indices 2024-11-21 23:22:15 -05:00
teoxoy ac74f36590 [wgpu-core] rename .strict_get() to .get() 2024-09-10 11:58:54 +02:00
teoxoy 31edbfd0dc [wgpu-core] use .strict_get() & .strict_unregister() for command buffers
We now only rely on the presence of the inner `CommandBufferMutable` to determine if command buffers are invalid.
2024-09-10 11:58:54 +02:00
teoxoy b14fe14e88 [wgpu-core] use Fallible for QuerySet 2024-09-10 11:58:54 +02:00
teoxoy 68e8b7d4a8 [wgpu-core] introduce Fallible and use it for Buffer (first step of invalidity internalization) 2024-09-10 11:58:54 +02:00
teoxoy eb47449eb9 invalidate the device when we encounter driver-induced device loss or on unexpected errors 2024-09-09 15:03:19 +02:00
Andreas Reich 24498f04d4 The second unraveling: hub and all types on it are generic free!
gfx_select macros are empty husks now that are waiting to be removed
2024-08-14 17:34:11 +02:00
Andreas Reich 7c7e4164f1 The big unraveling: core device now has a boxed DynDevice, ripple effects from there leading to boxing of almost all hal resources 2024-08-14 17:34:11 +02:00
teoxoy b0cc0d2ebc use QuerySet.raw() instead of QuerySet.raw.as_ref().unwrap() 2024-08-13 00:55:32 +02:00
teoxoy 152a7e7dd0 remove unnecessary PhantomData 2024-07-09 10:48:52 +02:00
teoxoy e26d2d7763 move command buffer resolving in Global's methods 2024-07-03 15:01:41 +02:00
teoxoy dbcb273188 remove StatelessTracker.add_single 2024-07-03 15:01:41 +02:00
teoxoy 3547138716 remove PrettyError 2024-07-02 18:06:19 +02:00
teoxoy 1841857fea use .check_usage() for QUERY_RESOLVE 2024-07-02 18:06:19 +02:00
teoxoy a4bb5dff2b rename error variants that contain IDs 2024-07-02 18:06:19 +02:00
teoxoy c63f0a02f2 introduce Trackable trait 2024-07-02 18:06:19 +02:00
teoxoy 3c389b9057 resolve occlusion query set prior to render_pass_end_impl 2024-06-27 10:20:11 +02:00
teoxoy 8ee9df9eb3 move same device check and tracker insertion inside validate_and_begin_pipeline_statistics_query 2024-06-27 10:20:11 +02:00
teoxoy 06da3e88d0 remove IDs from QueryResetMap 2024-06-25 11:14:41 +02:00
teoxoy 7bd9195aa2 take resource lookup out of StatelessTracker.add_single 2024-06-20 16:34:17 +02:00
teoxoy a024afe182 consolidate destroyed texture/buffer errors and separate them from invalid ID errors 2024-06-20 16:34:17 +02:00
teoxoy a979d2ed46 simplify BufferTracker.set_single's return type 2024-06-20 16:34:17 +02:00
teoxoy 43177d78d6 replace uses of Id.backend() with A::VARIANT 2024-06-20 16:34:17 +02:00
teoxoy ce716adb5e improve device mismatch errors 2024-06-19 11:15:38 +02:00
teoxoy 53f8477b15 validate for same device via Arc::ptr_eq rather than IDs 2024-06-19 11:15:38 +02:00