Commit Graph
42 Commits
Author SHA1 Message Date
Zac Harrold 34f7efb7d4 [wgpu-core]: Switch to wgpu-sync for locking primitives 2026-08-14 20:47:05 -04:00
Sam 5cd735daf4 Extract IDs, Registries and Global into wgpu-core-remote (#10053) 2026-08-14 14:24:01 +02:00
Sam 9e7ae880cd [core] Implement poll_all_devices on Instance (#9829)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-07-07 19:25:01 +02:00
Sam 5e139ccbeb [core] Add support IDed RenderPasses in Global (#9740)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-06-30 15:30:02 +02:00
Andy Leiserson 0c270be636 refactor(core): Improve registry storage assertions 2026-06-25 11:14:46 -07: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 2c81896e85 Small changes to facilitate fuzzing (#7970) 2025-07-21 13:51:57 +02:00
Jim Blandy 2f890eb9b2 [core] Improve assert failure message for id epoch mismatches. (#7871) 2025-07-02 09:33:55 +02: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
teoxoy 952ba3e12c move queue methods on the Queue type 2024-10-14 13:24:44 +02:00
Teodor Tanasoaia c8beade187 remove backend from ID (#6263) 2024-09-13 17:30:38 +02:00
teoxoy c4110afc7f [wgpu-core] inline Storage.insert_impl() 2024-09-10 11:58:54 +02:00
teoxoy c182d3f24f [wgpu-core] rename .strict_unregister() & .strict_remove() to .remove() 2024-09-10 11:58:54 +02: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 98426329a4 [wgpu-core] introduce Registry .strict_get() & .strict_unregister() and use them for adapters
This works because we never assign errors to adapters (they are never invalid).
2024-09-10 11:58:54 +02:00
teoxoy 70a9c01b48 [wgpu-core] make the Registry generic over T: Clone 2024-09-10 11:58:54 +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 3181251577 Core adapter no longer uses any generics 2024-08-14 17:34:11 +02:00
Nicolas Silva 9c6ae1beae Log spring cleaning (#6065)
Remove unused logs in wgpu-core and wgpu-hal
2024-07-31 16:24:23 +00:00
teoxoy 3df4c8a502 remove unused std::ops::Index impl for Storage 2024-07-03 15:01:41 +02:00
teoxoy 39a268c624 remove FutureId.assign_existing 2024-07-03 15:01:41 +02:00
teoxoy d8b0b5975d assign resources/errors in the Global's pipeline creation functions 2024-07-02 18:06:19 +02:00
teoxoy 1f6ac35e83 change Storage.force_replace to take an Arc<T> 2024-07-02 18:06:19 +02:00
teoxoy 896418c740 Panic on non-existent entry in Storage.get, this is consistent with Element::Vacant 2024-07-02 18:06:19 +02:00
teoxoy 16c7d84d63 remove Registry.try_get() 2024-07-02 18:06:19 +02:00
teoxoy ed1e8ecf4b remove label getters from Global
Also removes label from `Element::Error` and slightly refactors ContextError.
2024-07-02 18:06:19 +02:00
teoxoy ae7da8f669 introduce Labeled trait 2024-07-02 18:06:19 +02:00
teoxoy 727956fcde introduce StorageItem trait 2024-07-02 18:06:19 +02:00
Jim Blandy b7519bb73b [core] Make Hub members and related types pub(crate), not pub. (#5502) 2024-04-10 19:52:16 -04:00
Connor FitzgeraldandAndreas Reich faed98b45c Add typos to Repository CI (#5191)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-02-05 12:30:29 -05:00
John-John Tedro dec6ea5ea4 Improve the consistency of identifiers (#5108) 2024-01-29 10:56:04 +01:00
Nicolas Silva bc65d84cdb Remove the Destroyed state from Storage (#4970)
* Remove the Destroyed state from Storage

It used to be how we handled destroying buffers and textures but we moved to different approach.

* Explicit check for destroyed textures/buffers in a few entry points

This used to be checked automatically when getting the resource from the registry, but has to be done manually now that we track we track the destroyed state in the resources.
2024-01-11 10:45:12 +00:00
Connor Fitzgerald e26a853654 BGL Weak Pointer Deduplication Pool (#4927)
* Ho boy

* BGL pool finished

* Remove id32 feature

* Add BGL Test

* Iteration

* Working Dedupe

* Tests

* Iteration

* Re-iteration

* Hash Cleanup

* Add large slew of tests

* Whoops
2024-01-02 09:27:22 -05:00
Nicolas Silva 10dd5844ac Allow clippy::pattern_type_mismatch (#4887) 2023-12-17 15:00:02 -05:00
Mauro Gentile 238c3732a4 Don't keep a strong ref in storage for destroyed resources (#4786) 2023-11-27 13:37:09 +01:00
Nicolas Silva ca4e1313f7 Downgrade some of wgpu_core's logging level from info to trace and debug (#4771)
* Downgrade storage log level from info to trace

* Downgrade tracking log level from info to trace

* Demote present log from info to debug

* Downgrade device/life.rs log from info to debug and trace

* Downgrade more log from info to trace
2023-11-24 20:09:36 +01:00
6e21f7a929 Arcanization of wgpu core resources (#3626)
Arcanization of wgpu_core resources

---------

Co-authored-by: Elabajaba <Elabajaba@users.noreply.github.com>
Co-authored-by: Niklas Korz <niklas@niklaskorz.de>
Co-authored-by: grovesNL <josh@joshgroves.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: Mauro Gentile <Mauro.Gentile@ubisoft.com>
Co-authored-by: Sludge <96552222+SludgePhD@users.noreply.github.com>
2023-11-20 08:41:52 +01:00
Nicolas Silva f5665f73bd Prevent panic in untrack if a resource is already destroyed 2023-11-15 12:15:16 +01:00
Nicolas SilvaandTeodor Tanasoaia a697e4352c Keep the value in its storage after destroy (#4678)
* Keep the value in its storage after destroy

in #4657 the destroy implementation was made to remove the value from the storage and leave an error variant in its place.
Unfortunately this causes some issues with the tracking code which expects the ID to be unregistered after the value has been fully destroyed, even if the latter is not in storage anymore.
To work around that, this commit adds a `Destroyed` variant in storage which keeps the value so that the tracking behavior is preserved while
still making sure that most accesses to the destroyed resource lead to validation errors.

... Except for submitted command buffers that need to be consumed right away. These are replaced with `Element::Error` like before this commit.

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2023-11-14 14:23:23 +00:00
Nicolas Silva 1dc5347b14 Better handle destroying textures and buffers (#4657)
* Better handle destroying textures and buffers

Before this commit, explicitly destroying a texture or a buffer (without dropping it)
schedules the asynchronous destruction of its raw resources but does not actually mark
it as destroyed. This can cause some incorrect behavior, for example mapping a buffer
after destroying it does not cause a validation error (and later panics due to the
map callback being dropped without being called).

This Commit adds `Storage::take_and_mark_destroyed` for use in `destroy` methods.
Since it puts the resource in the error state, other methods properly catch that
the resource is no longer usable when attempting to access it and raise validation
errors.

There are other resource types that require similar treatment and will be addressed
in followup work.

* Add a changelog entry
2023-11-09 15:48:06 +01:00
Jim Blandy 4d1fbeb753 wgpu-core: Move storage code to new storage module. 2023-05-24 09:54:03 -07:00